SA-MP Forums Archive
MYSQL error 1064 - 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 error 1064 (/showthread.php?tid=595700)



MYSQL error 1064 - Alex_T - 06.12.2015

Код:
SaveAccounts(playerid)
{
	new query[400];
	format(query, sizeof(query), "UPDATE `accounts` SET `adminlevel` = %d, `vip` = %d, WHERE `id` = %d", pInfo[playerid][Admin], pInfo[playerid][VIP], pInfo[playerid][ID]);
	mysql_tquery(mysql, query, "EmptyCallback", "");
	return 1;
}
Код:
[14:43:36] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET `adminlevel` = 9999, `vip` = 0, WHERE `id`", callback: "EmptyCallback", format: "(null)"
[14:43:36] [DEBUG] CMySQLQuery::Execute[EmptyCallback] - starting query execution
[14:43:36] [ERROR] CMySQLQuery::Execute[EmptyCallback] - (error #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 'WHERE `id` = 0' at line 1
[14:43:36] [DEBUG] CMySQLQuery::Execute[EmptyCallback] - error will be triggered in OnQueryError
[14:43:36] [DEBUG] Calling callback "OnQueryError"..



Re: MYSQL error 1064 - CmZxC - 06.12.2015

Код:
`vip` = %d,
unnecessary comma at the end


Re: MYSQL error 1064 - Alex_T - 06.12.2015

Quote:
Originally Posted by CmZxC
Посмотреть сообщение
Код:
`vip` = %d,
unnecessary comma at the end
Thank you. Another set of eyes is always better