SA-MP Forums Archive
Insert query not working - 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: Insert query not working (/showthread.php?tid=538532)



Insert query not working - arko123 - 22.09.2014

Error:
pawn Код:
[09:43:03]  ErrorID: 1064 | 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 ' VALUES('Mersey', '758DA252C75574FB9AC02057BBA14DBFBCADBE0E4DD9A1E039A71DFDC4AF7' at line 1 | Query: INSERT INTO `accounts` (name, password), VALUES('Mersey', '758DA252C75574FB9AC02057BBA14DBFBCADBE0E4DD9A1E039A71DFDC4AF7957F015654D6049F063F6C670736AB064E709866CEB2CDC45833DBE99C3F42C996B')
Code:
pawn Код:
new
    hashedPassword[255],
    string[450];
                       
WP_Hash(hashedPassword, sizeof hashedPassword, inputtext);
                       
mysql_format(mysqlHandle, string, sizeof string, "INSERT INTO `accounts` (`name`, `password`), VALUES('%e', '%e')", PlayerName(playerid), hashedPassword);
mysql_function_query(mysqlHandle, string, false, "", "");



Re: Insert query not working - arko123 - 22.09.2014

bump


Re: Insert query not working - biker122 - 22.09.2014

pawn Код:
new
    hashedPassword[129],
    string[450];
                       
WP_Hash(hashedPassword, sizeof hashedPassword, inputtext);
                       
mysql_format(mysqlHandle, string, sizeof string, "INSERT INTO `accounts` (`name`, `password`) VALUES('%e', '%e')", PlayerName(playerid), hashedPassword);
mysql_function_query(mysqlHandle, string, false, "", "");



Re: Insert query not working - arko123 - 22.09.2014

Nevermind, fixed it.
Edit:
Quote:
Originally Posted by biker122
Посмотреть сообщение
pawn Код:
new
    hashedPassword[129],
    string[450];
                       
WP_Hash(hashedPassword, sizeof hashedPassword, inputtext);
                       
mysql_format(mysqlHandle, string, sizeof string, "INSERT INTO `accounts` (`name`, `password`) VALUES('%e', '%e')", PlayerName(playerid), hashedPassword);
mysql_function_query(mysqlHandle, string, false, "", "");
Thank you anyways