SA-MP Forums Archive
SQL syntax error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SQL syntax error (/showthread.php?tid=251827)



SQL syntax error - BritishBoy - 28.04.2011

I have a problem with this lines

Код:
format(query, sizeof(query), "INSERT INTO `accounts` (`username`,`spassword`,`emailaddress`,`ipaddress`) VALUES ('%s', '%s', '%s', '%s')", Cname, Cpassword, Cemail, Cipaddress); 
mysql_query(query);
Error:
Код:
CMySQLHandler::Query(INSERT INTO `accounts` (`username`,`spassword`,`emailaddress`,`ipaddress`) VALUES ('Battleman', 'examplepassword', 'example@mail.com', '192.168.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 ''192.168.1' at line 1)
I don't know how to fix this. Anybody?


Re: SQL syntax error - [L3th4l] - 28.04.2011

Increase the size of
pawn Код:
new
    query[];



Re: SQL syntax error - X3nZ - 29.04.2011

Код:
CMySQLHandler::Query(INSERT INTO `accounts` (`username`,`spassword`,`emailaddress`,`ipaddress`) VALUES ('Battleman', 'examplepassword', 'example@mail.com', '192.168.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 ''192.168.1' at line 1)
You didn't include the last .1 or what ever it is for you.