-
PHP-MySQL problems
Hi,
I would like to create my own forum and I'm using this code to insert the nickname, message and date of posting into my database.
mysql_query('INSERT INTO "Database" [("IndexCol", "NicknameCol", "MessageCol"), "DateCol"] VALUES ("1", {$_POST["Nickname"]}, {$_POST["Message"]}, {date()})');
Someone explained me this but it doesn't work. I have no idea on how to fix this. Is there anyone who could help me?
(names were changed)
Thanks in advance
-
Hi there.
I saw your site is in French.
I can speek French too.
Go to http://www.phpcs.com/
Try this:
$rq="INSERT INTO Database (IndexCol,NicknameCol,MessageCol,DateCol) VALUES ('1',{$_POST['Nickname']},{$_POST['Message']},date())";
$result=mysql_query($rq) or die ("Error while inserting");
Why do you insert always the value "1" for IndexCol?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks