MySQL Syntax
#1

Hello, maybye someone know what is wrong with this line:
Code:
"SELECT * FROM 'cars' WHERE savininkas = '%s', kiekis = '1' LIMIT 1"
In mysql_log.txt i get this error:
Code:
CMySQLHandler::Query(SELECT * FROM 'cars' WHERE savininkas = 'Cristiano_Fernandes', kiekis = '1' LIMIT 1) - An error has occured. (Error ID: 1064, 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 ''cars' WHERE savininkas = 'Cristiano_Fernandes', kiekis = '1' LIMIT 1' at line 1)
Reply
#2

Code:
"SELECT * FROM cars WHERE savininkas = '%s', kiekis = '1' LIMIT 1"
You specify table name without ' '
Reply
#3

Maybe should be:
pawn Code:
"SELECT * FROM cars WHERE savininkas = '%s' AND kiekis = 1 LIMIT 1"
Also do not forget to see what QuaTTro said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)