
09-11-2007
|
| Administrator
Join Date: Jun 2007
Posts: 3,729
BRL$: 30,442.05 Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 402 | | Help With Inserting Into a Database I'm using the following code to insert a row into mysql database. It inserts the information but inserts three rows instead of one. Maybe I'm just overly tired but i cant seem to figure out why... Can anyone help me out? PHP: --------- if ($error>0) { echo "This script has been terminated due to one or more errors. Please read the errors above and try again
"; include "common/end.php"; die(); } else { $name2 = htmlspecialchars($name); $message2 = htmlspecialchars($message); $today=date("U"); $addmessage = "INSERT INTO messages (id, name, date, message) VALUES ('', '$name2', '', '$message2')"; $addmessage2 = mysql_query($addmessage) or DIE ("Could not add message"); echo "Message was successfully added to the database. You should be able to see it instantly.
"; } --------- To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. | |
__________________ █ High Quality To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
█ Powerful To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
█ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. | | | |