Add to Google

What Value Would I Use To Insert This Data? - Help on insertion of data to database?

free web hosting
Open Discussion > CONTRIBUTE > Computers > Database

What Value Would I Use To Insert This Data? - Help on insertion of data to database?

TheChosenDarkness
I am learning slowly but surely and I know some of you probably getting tired of my questions. ^^;; However, I believe one can not learn without asking questions. So.. if I get too bothersome.. just point me to some books or something. lol XD

CODE
<?php
// Make a MySQL Connection
mysql_connect("localhost", "name", "password") or die(mysql_error());
mysql_select_db("at2927_abq") or die(mysql_error());

// Insert a row of information into the table "example"
mysql_query("INSERT INTO members
(pasture) VALUES('Timmy Mellowman', '23' ) ")
or die(mysql_error());

echo "Data Inserted!";

?>



Okay, what Value or Values do I need to put? I am making a page decorator for my registered users and I want the text to "stick" to the page. I was told I would need to "insert" the data and the "retrieve" the data in order for it to stick. So.. what Value(s) would I use?

Here is the form I created (with help of course):

CODE
<?php
if(count($_POST) > 0)
{
$changepage = $_POST['changepage'];
// do any extra formatting you need to the string var $changepage here
// output it back here
echo " <tt>$changepage</tt> ";
}
?>

<form action="pasture.php" method="post">
<TEXTAREA class="text" name="changepage" COLS="80" ROWS="15">
<?php
echo "$changepage"?>
</textarea>
<br><input type="submit" value="Change">
</form>


So I want to take the submitted data and make it "stick" to the page. So what would be the Value for the database to store and then for me to retrieve?

Hoping I got the database set up right for this type of insertion and retrievial. =]

 

 

 


Reply

darran
Not sure if I understood your question right, by values do you mean what kind of datatype you need to use for your specific columns in your table? If that is the case, a good choice to use would be varchar, but then again it would be wise to set limits on the number of characters which could be stored as it would cause some huge process overhead in the long run when there are a huge number of users using this form.

Reply

TheChosenDarkness
Okay, I am trying to get "layout" content to insert into a database and then "retrieve" it. So it will stick on the page I want it to. However, I am not sure what to tell the code to insert. I have a form and I basically want the form insert "text" into the database.

For example.. where the name and age is on the example.. what would I put there to tell the code to "insert" the layout data?

---

To better phrase the question: How do I get to form to insert the data into the database? Much like you do with registering users, except I want to insert text. Like in layouts or stories, etc. That way I can retrieve it and have it "stuck" to the page until I user wants to change it.

Reply

sonesay
When you say layout content are you referring to html tags and what ever else content the user inserts into the form then submits? If that is the case and you want to store it to be retrieved later you will need a database table setup to accept the submitted text area by the user.

Reply

jlhaslip
See your other thread.

http://www.trap17.com/forums/index.php?s=&...st&p=380106

Also notice that I have closed this topic. You have 3 about the same issue.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Similar Topics

Keywords : insert, data, insertion, data, database,

  1. Php Myadmin
    can't access mysql database (6)
  2. Database Normalization
    (0)
    For those of you... who really reall Ok... I am sharing to trap17 an easy to use image file to
    brush up your understanding of database normalization. Everytime I have to understand the concepts,
    I have to go through the complete text and its a little hard to do that... Had some requirement
    recently, and I thought I will prepare something like this and refer to, when there are future
    requirements. This is not exhaustive and very detailed. Helps to get some basic understanding. Prior
    knowledge about the databases, structure will help in understanding the complete concepts....
  3. Need Advice On Setting Up Mysql Database.
    I have a huge amount of daily data updates to be inserted. (4)
    First of all, to get the idea of what I am trying to achieve here, please have a look at my
    idea thread, entitled Idea For Using A Cron Job To Grab Daily Travian Map.sql Updates . This gives
    a prelude to the project, what it is for, what it is supposed to do, etc. Now, what I need is
    specific advice on setting up the mySQL database(s) to implement this idea. There is a useful FAQ
    file for how to make use of the map.sql data located on the help.travian.com website, which also
    gives an example of the CREATE TABLE instruction that matches the data in the map.sql fi....
  4. Database Or Pdf
    Best way to list books on my site (3)
    Hi all, I am not sure if this is the right place to post but I'm sure you'll tell
    me if it's not. My problem is this: I have a website where I sell books and it's one of
    those simpleton sites where I don't need to know code, I just click icons etc Anyway, I can
    upload images to the server and need to have them in different resolutions and link from a thumbnail
    to the larger picture. What I am trying to say is I have about 6000 books to display on my
    website which is impractical as it takes me about 10 mins to load 1 copy. What is the ....
  5. Database With Mysql++
    getting mySQL++ to work with trap17 (7)
    Hi, I'm trying to build an online game and figured the easiest way to do the server list would
    be to make a mySQL database for it; however, I use the con() command on the IP i get from pinging my
    website and I always get an abnormal program termination; however, it will work with the mySQL on my
    own machine. The code is below: CODE #include #include #include #include "pass.h"//holds
    my password (i program at school) int main(void) {     Connection
    con("t3jem3_test","64.69.46.210","t3jem3_t3jem",pass);     Query query = con.query();     query
        Re....
  6. Php With Simple Csv List As Database, What Do U Think?
    (2)
    I've designed a php website and i used simple CSV file as my database because of few reasons
    my client had to pay more to active MySQL database was a simple product list it was easy to
    convert product list from existing Excel file to CSV it is easy to make any changes so i have few
    files to convert to CSV if i wanna update the website. I know it's less secure specially if
    it's an online business (which is not). question is : what are disadvantages? is that slower
    than MySQL? is there more possibility of occurring bug? is that less professional? or ......
  7. Forum Database
    Forum Database Space and its capacity to hold content (9)
    Okay, I have a forum which is growing daily. Even though members aren't that many, I'm still
    concerned over my database space and its capacity to hold the forum's content. Since post counts
    take up database space, the remaining space will decrease daily, albeit by little amounts. Still, it
    will decrease anyway and eventually my database for that forum will run out of space. My question
    is: 1. Is there any way to possibly create a new database to continue holding the old
    database's increasing data? As in, my old database is there but its full and I creat....
  8. Database Migration - Seditio To Joomla
    any help is needed (1)
    Hi guys! I was desperately looking on internet for any help with migrating Seditio database to
    Joomla.. I`m admin on site which has more than 2500 members and day by day I get annoyed by pretty
    dumb solutions in Seditio.. can anyone tell me how to migrate the seditio site to joomla? any
    tutorials on internet on database migration? thanks....
  9. Best Database Software?
    (1)
    I'm quite new to creating and managing databases - yesterday I installed Filemaker Pro 9 and my
    initial thoughts are that it's amazing! Only just starting to get to grips with it - think
    it'll take some time to master it. What Database software do others use and what do people
    think of Filemaker Pro? Advantages/Disadvantages? ....
  10. Questioning My Database Structure...
    (4)
    Okay, I posted a brief description of this in the PHP section, but I'll summarize myself again.
    I'm creating a PHP based game that is an economy game, where you start out with so many
    resources and a building, and you expand your business empire by building more buildings, which puts
    out more resources, and you can buy and sell on the market and whatnot. In the end, you try and
    become the wealthiest player in the game. Now I already have most of my database in MySQL set-up.
    But I've been told several different things on my structure and wanted your guys'....
  11. Data Base For A War Game
    need data base (5)
    Hey, any one can give me a sight to get databases for war games, a database that could include units
    hp,speed,power and similar things. And if you can how can i put the numbers I want as hp,speed and
    other things as i want. ....
  12. How To Connect Site To Database? [resolved]
    (12)
    I created a table in phpmyadmin, i copied the code in a file and uploaded this file onto the host.
    Now it says that it cannot connect to the database. The error lies within "mysql_select_db($db)" =>
    so i think this means that it cant find the database? If anyone knows how to let my login and
    register forms connect to the database, please help me. I used a login system from this site, ill
    post the link later.....
  13. Exporting Database Problems
    (3)
    On the host I moved here from, I have a database that I would like to transfer. On this host I am
    unable to use PHPMyAdmin, but I have MySQL-Admin 3.3 that works fine. But the main problem is the
    host. Recently they made it so you there is only a 1mb upload limit, and also that MySQL temporarily
    will not operate properly. Which is basically why I want to get off that host. Anyway, I can export
    each of the small tables easily. But I have tables that are over 2mb, and I do not know how I can
    get them. When I click on "Show table", the table starts to load, but then it sto....
  14. Mysql Database Copying
    (4)
    Is there anyway to merge 2 databases? I have an XOOPS and SMF both installed with Fantastico, and
    the bridge is not working like the Joomla! one does. (with the seperate db capability) i know how
    to transfer all the tables by hand but depending on how much data you have stored in mysql could
    take a long time. Take short time!? Help me!....
  15. Joomla Sql Error: Connection To Database Server Failed.
    (1)
    Hi Today I got this error-message in back-end on my Joomlasite hewwelub.trap17.com/d-lan/
    QUOTE This site is temporarily unavailable. Please notify the System Administrator Connection to
    database server failed. This is the first time I get this error, and I don't want or have
    the time to reinstall the site with all its features... The only time I have seen this problem yet
    is when I tried to unpublish a menu item. Any answer would be to great help, thanx /smile.gif"
    style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />....
  16. Connecting Php With Oracle Database
    (1)
    i need to connect oracle with php ..now me using oracle 10g can any one give me the solution
    thanks.....
  17. Mannual Creation Of Oracle Database
    (0)
    Manual Creation of database in windows with oracle 9i (Step-by-Step) (Name of the database=db18)
    (Note: all commands are in bold letters) 1. Open the command prompt and execute the command
    sqlplus/nolog 2. Connect to the default database as sysdba in sql prompt SQL>conn sys/oracle as
    sysdba you can see the name of that database by executing select name from v$database; 3. Now open
    another command prompt and set oracle SID as set oracle_sid=db18 4. Start a windows service with
    internal password oradim –new –sid intpwd is the syntax. In this case I use ceylonlinux_sura....
  18. Mysql Tools Database
    Opensource sql tools... (1)
    You can download mysql query web browser on http://www.mysql.com you also can download plugin
    there...like conector mysql from visual basic ,java,etc with my sql query tool browser you can make
    and maintance youre database sql easily because use gUI interface..!!....
  19. Data Access Pages ?
    Help or Assistance with creating a data access page to collect data fr (1)
    QUOTE Hello All. I'm looking for some advise or assistance with getting a web page/access
    page running so that i can have the page online and collect the data live into my database for
    Project Management... Currently I'm developing a database using M$ Access, and need to have
    staff data enter sales information directly into a web form that can be linked to a database?
    I've looked at using a M$ Front page web form with data collected into a .CSV text file and
    extracting the data but i need to be able to let the staff review and update the data for each ....

    1. Looking for insert, data, insertion, data, database,






*SIMILAR VIDEOS*
Searching Video's for insert, data, insertion, data, database,

*MORE FROM TRAP17.COM*
advertisement



What Value Would I Use To Insert This Data? - Help on insertion of data to database?