SA-MP Forums Archive
help mysql - 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: help mysql (/showthread.php?tid=577340)



help mysql - capottematias - 10.06.2015

helppp

error:
Quote:

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 '`rango1' at line 1 - Callback - OnQueryFinish - Query: INSERT INTO `faccion`(`nombre`, `numero`, `rango1

Quote:

stock crearusefacc(playerid)
{
new pName[24], Query[50];
GetPlayerName(playerid, pName, 24);
format(Query, sizeof(Query), "INSERT INTO `faccion`(`nombre`, `numero`, `rango1`) VALUES (%s, %d, %d)", pName, UserInfo[playerid][pFaccion], UserInfo[playerid][rank]);
mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 0, playerid);
return 1;
}




Re: help mysql - Konstantinos - 10.06.2015

Strings need ' ' around %s or %e (escaped) specifier.

pawn Код:
"INSERT INTO `faccion`(`nombre`, `numero`, `rango1`) VALUES ('%s', %d, %d)"



Respuesta: Re: help mysql - capottematias - 11.06.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Strings need ' ' around %s or %e (escaped) specifier.

pawn Код:
"INSERT INTO `faccion`(`nombre`, `numero`, `rango1`) VALUES ('%s', %d, %d)"
Follow the error


Re: help mysql - mamorunl - 11.06.2015

Also, your query length is too short. The query as it stands right now (without data) is already 72 chars. Your length is 50