Jump to content

shmickvl

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by shmickvl

  1. thanks it worked!!!!!!! yay!!! its been bugging me for hours. im learning mysql/php :) thanks again guys. so simple!!!
  2. Hi guys im having some trouble. i create a table in phpmyadmin, with two fields for example: id and name. i set my id field to auto increment, not null, and the primary key. i have made a "index.html" form to submit data, and made my "submission.php" page which takes it all there. The problem is that in my table, if i have the id field, data will not go to the database. However, if i delete the id field, it will go there. PLease help attached are my codes. <html> <body> <form action="submission.php" method="post"> First Name: <input type="text" name="name"><br> <input type="Submit"> </form> </body> </html> <? $name=$_POST['name']; mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("example") or die(mysql_error()); mysql_query("INSERT INTO `example1` VALUES ('$name')"); Print "Your information has been successfully added to the database."; ?> cheers for your help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.