Newbie SQL decode

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
SL-Cowsrule
Forum Newbie
Posts: 13
Joined: Sat Oct 12, 2002 5:08 pm

Newbie SQL decode

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

join is a reserved name in (my)sql.
Either change your tablename or use backticks.
SL-Cowsrule
Forum Newbie
Posts: 13
Joined: Sat Oct 12, 2002 5:08 pm

thanks

Post by SL-Cowsrule »

Thanks a lot, i had no clue :)

CoW
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply