CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your -
akib - 28.03.2018
I am facing a proble, while i try to save stats on mysql database...
here is the code :
PHP Code:
SavePlayer(playerid)
{
new Float:x,Float:y,Float:z,Float:Angle;
GetPlayerFacingAngle(playerid, Angle);
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
sInfo[playerid][money] = GetPlayerMoney(playerid);
sInfo[playerid][level] = GetPlayerScore(playerid);
sInfo[playerid][s_posx] = x;
sInfo[playerid][s_posy] = y;
sInfo[playerid][s_posz] = z;
sInfo[playerid][s_angle] = Angle;
new query[128];
format(query, sizeof(query), "UPDATE users SET money='%i', level='%i', pos_x='%f', pos_y='%f', pos_z='%f', angle='%f' WHERE id='%i'", sInfo[playerid][money],sInfo[playerid][level],sInfo[playerid][s_posx],sInfo[playerid][s_posx],sInfo[playerid][s_posz],sInfo[playerid][s_angle],sInfo[playerid][db_id]);
mysql_function_query(dbhandle, query, false, "", "");
return 1;
}
Re: CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to -
Dayrion - 28.03.2018
Instead of posting the error as the title, post the full logs associate in the post.
Re: CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to -
AdamsLT - 28.03.2018
The syntax seems fine. You sure this is the correct error line?
Post the full error logs like Dayrion asked.
Unrelated to the error: when formatting the query you use s_posx twice (for both X and Y coords).
Re: CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to -
akib - 28.03.2018
Quote:
Originally Posted by Dayrion
Instead of posting the error as the title, post the full logs associate in the post.
|
Sorry for the mistake....
Quote:
Originally Posted by AdamsLT
The syntax seems fine. You sure this is the correct error line?
Post the full error logs like Dayrion asked.
Unrelated to the error: when formatting the query you use s_posx twice (for both X and Y coords).
|
the whole mysql log have only 1 error line...
Pic
Re: CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to -
ForCop - 28.03.2018
Quote:
Originally Posted by akib
I am facing a proble, while i try to save stats on mysql database...
here is the code :
PHP Code:
SavePlayer(playerid)
{
new Float:x,Float:y,Float:z,Float:Angle;
GetPlayerFacingAngle(playerid, Angle);
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
sInfo[playerid][money] = GetPlayerMoney(playerid);
sInfo[playerid][level] = GetPlayerScore(playerid);
sInfo[playerid][s_posx] = x;
sInfo[playerid][s_posy] = y;
sInfo[playerid][s_posz] = z;
sInfo[playerid][s_angle] = Angle;
new query[128];
format(query, sizeof(query), "UPDATE users SET money='%i', level='%i', pos_x='%f', pos_y='%f', pos_z='%f', angle='%f' WHERE id='%i'", sInfo[playerid][money],sInfo[playerid][level],sInfo[playerid][s_posx],sInfo[playerid][s_posx],sInfo[playerid][s_posz],sInfo[playerid][s_angle],sInfo[playerid][db_id]);
mysql_function_query(dbhandle, query, false, "", "");
return 1;
}
|
it may be necessary to increase the size.
in format 102 size
in float 32 size
in int +- 20 size
Re: CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to -
akib - 29.03.2018
Quote:
Originally Posted by ForCop
it may be necessary to increase the size.
in format 102 size
in float 32 size
in int +- 20 size
|
Thanks it's working.