SA-MP Forums Archive
MYSQL syntax!? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL syntax!? (/showthread.php?tid=335171)



MYSQL syntax!? - Jstylezzz - 17.04.2012

Hey sa-mp,

I have a little problem out here..

I have made a little account system, with This thead.

Now i get this error on registering:
Код:
CMySQLHandler::EscapeString(password); - Escaped 10 characters to password.
[17:24:52] >> mysql_query( Connection handle: 1 )
[17:24:52] CMySQLHandler::Query(INSERT INTO `Users` (Username,Password,Money) VALUES ('Jari_Johnson','password,'0')) - 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 '0')' at line 1)
[17:24:52] OnQueryError() - Called.
[17:24:58] >> mysql_query( Connection handle: 1 )
[17:24:59] CMySQLHandler::Query(UPDATE `Users` SET `Money` = '5000' WHERE `Username` = 'Jari_Johnson' ) - Successfully executed.
Anyone knows what i have to do?
((maybe i am late with posting new things, i'm off to the hairdresser ))


Re: MYSQL syntax!? - Dynamic007 - 17.04.2012

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
Hey sa-mp,
CMySQLHandler::Query(INSERT INTO `Users` (Username,Password,Money) VALUES ('Jari_Johnson','password,'0'))
- 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 '0')' at line 1)
INSERT INTO `Users` (Username,Password,Money) VALUES ('%s','%s,'0')

Missing apostrophe ( ' ) after password. Change to:

INSERT INTO `Users` (Username,Password,Money) VALUES ('%s','%s','0')


Re: MYSQL syntax!? - Jstylezzz - 17.04.2012

Thanks, i will try this!