MYSQL syntax!?
#1

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 ))
Reply
#2

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')
Reply
#3

Thanks, i will try this!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)