Adding Record to database
| From: | Matt | Date: | Mon, 03 Feb 2003 01:41:59 +0000 |
| Subject: | Adding Record to database | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-25356@lists.php.net to get a copy of this message | ||
Hi. I am having a problem with adding a record into a table of a database.
I have attached the code I am using to accomplish this. It works if the
table is empty, but if there is already a record in the table, it won't add
anything. Could anyone help me out with this? Here is the code I am using:
$query = "INSERT INTO TableName
(SID,StudentLastName,StudentFirstName,StudentEmail,StudentLoginName,StudentP
assword) VALUES
('$SID','$StudentLastName','$StudentFirstName','$StudentEmail','$StudentLogi
nName','$StudentLoginPassword')";
$results = mysql_query($query);
Like I said, this works if the table is totally empty, but if there is
already an entry in there, it does nothing. Please help if you can.
Thanks.
Matt