Page 1 of 1

Newbie SQL decode

Posted: Tue Oct 15, 2002 6:16 pm
by SL-Cowsrule

Code: Select all

<?php
$query2 = "INSERT INTO join (id, username, password, emailadress, recruited, date) VALUES ('0', '$_POSTїusername]', '$_POSTїpassword]', '$_POSTїemailadress]', '$_POSTїrecruited]', '$timestamp')";
?>
This code returns this error:

You have an error in your SQL syntax near 'join (id, username, password, emailadress, recruited, date) VALUES ('0', 'Testin' at line 1

If you need more information then that, just ask. I dont know whats wrong, and its <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> me off :(

Thanks in advance,
CoW

Posted: Tue Oct 15, 2002 6:18 pm
by volka
join is a reserved name in (my)sql.
Either change your tablename or use backticks.

thanks

Posted: Tue Oct 15, 2002 6:39 pm
by SL-Cowsrule
Thanks a lot, i had no clue :)

CoW

Posted: Wed Oct 16, 2002 1:56 am
by twigletmac
There's a bunch of reserved names in MySQL (and SQL in general):
http://www.mysql.com/doc/en/Reserved_words.html

Mac