#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Mumbai, India
    Posts
    276
    Rep Power
    15
    I have a form. When the user add an entry, it should get added in the Mysql table.
    How is it done.
    Again, I have a databse of 600 records typed in excel can I use it as my MySql database so that I don't have to type it again.

    Here is part of the form.

    <FORM ACTION='email.php3' METHOD='POST'>

    Your ID:<BR>
    <INPUT TYPE='text' NAME='CatID' SIZE='20' MAXLENGTH='30'>
    <P>
    Your name <BR>
    <INPUT TYPE='text' NAME='CatName' SIZE='20' MAXLENGTH='30'>


    ------------------
    Thanks
    Shantanu
    Learn HTML and Java at
    http://www.oksoft.com
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    32
    Rep Power
    15

    // Split the variables into their individual variables..
    while (list($name, $value) = each($HTTP_POST_VARS));

    // connect into the database..
    $db = mysql_connect ("localhost","username", "password");
    mysql_select_db("database",$db);

    // Inserting the values into tablename..
    $sql_insert = "INSERT INTO tablename ( catID, catName ) VALUES ( '$catID', '$catName' )";

    mysql_query($sql_insert);

    good luck with the rest
    scoobydoo

Similar Threads

  1. mysql connect issue
    By slen in forum MySQL Help
    Replies: 1
    Last Post: February 17th, 2004, 04:33 AM
  2. Replies: 1
    Last Post: February 5th, 2004, 12:50 AM
  3. Replies: 5
    Last Post: February 3rd, 2004, 02:59 PM
  4. HTTP Error 400: Bad Request, with basic form
    By crackwombat in forum PHP Development
    Replies: 1
    Last Post: January 23rd, 2004, 07:40 PM
  5. Validate PHP form and update MySQL table
    By tlugosi in forum PHP Development
    Replies: 2
    Last Post: January 18th, 2004, 03:26 PM

IMN logo majestic logo threadwatch logo seochat tools logo