10.10.2016, 17:42
Quote:
Seems like %q specifier replaces with '' instead of \', at least that's what it printed for a single apostrophe.
Just use mysql_format and '%e' and you'll have no problems. --- As for strtok and non-threaded queries, consider use better methods (sscanf and threaded queries). |
Код:
format(string,sizeof(string),"INSERT INTO `logs_admin` (`Nombre`,`Administrador`,`Tipo`,`Motivo`,`Tiempo`,`IP`,`IP_Administrador`) VALUES ('%e','%e','1','%e','%e','%e','%e')",GetPlayerNameRP(playerid2),GetPlayerNameRP(playerid),(result),time,plr2IP,plrIP); mysql_query(1, string);
Код:
[17:38:14] [ERROR] CMySQLQuery::Execute[()] - (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 ''e' at line 1 [17:38:14] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
![Confused](images/smilies/confused.png)
![Confused](images/smilies/confused.png)
![Confused](images/smilies/confused.png)
![Confused](images/smilies/confused.png)