View Full Version: MySQL error

Fake2knet > programming & game design > MySQL error



Title: MySQL error


Griven - March 27, 2008 07:28 PM (GMT)
i'm in the process of learning php and i keep getting this error...

Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join,ip,level) VALUES('peter','123456','peter@peter.com','date('Y-m-d H:i:s')','' at line 1

and here is the actual line from the code that it is trying to execute...

INSERT INTO members (username,password,email,join,ip,level) VALUES('peter','123456','peter@peter.com','date('Y-m-d H:i:s')','121.11.11.0','normal')

If you need the code for the whole page i can give it...it's just it seems irrelevant when it's a MySQL error and it's that line...

Griven - March 27, 2008 07:56 PM (GMT)
I got it!

apparently MySQL requires ` around column names and stuff...what stupidity...

HArry the motorsport enthusiast - March 27, 2008 09:57 PM (GMT)
not exactly

it requires you to quote column names that are also reserved words (keywords)

in this case, join is a reserved word because it is part of SQL syntax

Griven - March 27, 2008 10:08 PM (GMT)
that would make sense why the error started at join...thanks domonix




Hosted for free by InvisionFree