MYSQL - ERRORID: 1064 Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE `Nombre` = Steven_Dominguez' at line 1 Query: WHERE `Nombre` = Steven_Dominguez Callback: OnQueryFinish
stock ActualizarAccesorios(playerid, slot=-1) { if(slot == -1) { Loop(i, MAX_ACCESORIOS, 0) { ActualizarAccesorios(playerid, i); } } else if(slot > -1 && slot < MAX_ACCESORIOS) { new querystr [300] = "UPDATE `usuarios` SET ", str [500]; A_Format (str, "`AttachModel_%d` = %d,", slot, InfoJugador[playerid][jAttachModel][slot]); strcat (querystr, str); A_Format (str, "`AttachBone_%d` = %d,", slot, InfoJugador[playerid][jAttachModel][slot]); strcat (querystr, str); A_Format (str, "`AttachPosx_%d` = %f,", slot, InfoJugador[playerid][jAttachPosx][slot]); strcat (querystr, str); A_Format (str, "`AttachPosy_%d` = %f,", slot, InfoJugador[playerid][jAttachPosy][slot]); strcat (querystr, str); A_Format (str, "`AttachPosz_%d` = %f,", slot, InfoJugador[playerid][jAttachPosz][slot]); strcat (querystr, str); A_Format (str, "`AttachAngx_%d` = %f,", slot, InfoJugador[playerid][jAttachAngx][slot]); strcat (querystr, str); A_Format (str, "`AttachAngy_%d` = %f,", slot, InfoJugador[playerid][jAttachAngy][slot]); strcat (querystr, str); A_Format (str, "`AttachAngz_%d` = %f,", slot, InfoJugador[playerid][jAttachAngz][slot]); strcat (querystr, str); A_Format (str, "`AttachEscx_%d` = %f,", slot, InfoJugador[playerid][jAttachEscx][slot]); strcat (querystr, str); A_Format (str, "`AttachEscy_%d` = %f,", slot, InfoJugador[playerid][jAttachEscy][slot]); strcat (querystr, str); A_Format (str, "`AttachEscz_%d` = %f,", slot, InfoJugador[playerid][jAttachEscz][slot]); strcat (querystr, str); A_Format (str, "`AttachOcultado_%d` = %d ", slot, InfoJugador[playerid][jAttachOcultado][slot]); A_Format (str, "WHERE `Nombre` = %s", pName (playerid)); strcat (querystr, str); opmysql_tquery(str, "OnQueryFinish", "ii", playerid, query_type_unknown); } return 1; }
Oh for the love of ... Just use %e in mysql_format for whatever text you insert wherever. If it doesn't help it doesn't hurt either.
![]() |
A_Format (str, "WHERE `Nombre` = '%s'", pName (playerid));
MYSQL - ERRORID: 1064 Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE `Nombre` = e' at line 1 Query: WHERE `Nombre` = e Callback: OnQueryFinish
A_Format (str, "WHERE `Nombre` = %e", pName (playerid)); strcat (querystr, str); opmysql_tquery(str, "OnQueryFinish", "ii", playerid, query_type_unknown);
pawn Код:
|
[04/09/2017 22:02:56] MYSQL - ERRORID: 1064 Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE `Nombre` = 'Steven_Dominguez'' at line 1 Query: WHERE `Nombre` = 'Steven_Dominguez' Callback: OnQueryFinish
A_Format (str, "WHERE `Nombre` = '%e'", pName (playerid));