mysql error
#1

how to fix this?
HTML Code:
(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 'Car Mod Shop' se afla la locatia [/gps - Los Santos - Car Mod Shop].')' at line 1 (Query: "INSERT INTO questions (`Sender`,`Question`,`Helper`,`Response`) VALUES ('1689','* Newbie xx: si unde este un car mod shop?','127','* Helper xx: @xx, Un 'Car Mod Shop' se afla la locatia [/gps - Los Santos - Car Mod Shop].')")
line:
HTML Code:
new var100[500];
mysql_format(SQL,var100, sizeof(var100), "INSERT INTO questions (`Sender`,`Question`,`Helper`,`Response`) VALUES ('%d','%s','%d','%s')", PlayerInfo[PlayerInfo[playerid][pNRE]][pSQLID],PlayerInfo[PlayerInfo[playerid][pNRE]][pNMessage],PlayerInfo[playerid][pSQLID], string);
mysql_tquery(SQL,var100,"","");
Reply
#2

Debug it. Print all of the parameters with sendclientmessage or any other way you'd like to use, and see if everything looks good. If not, you could work out the solution from there.
Reply
#3

Escape the inputs. Replace '%s' with '%e'
Reply
#4

Here you are:
PHP Code:
new var100[500];
mysql_format(SQL,var100sizeof(var100), "INSERT INTO `questions` (`Sender`,`Question`,`Helper`,`Response`) VALUES ('%d','%e','%d','%e')"PlayerInfo[PlayerInfo[playerid][pNRE]][pSQLID],PlayerInfo[PlayerInfo[playerid][pNRE]][pNMessage],PlayerInfo[playerid][pSQLID], string);
mysql_query(SQL,var100); 
Next time double check your syntax! And if you are not calling any callback in the query, just don't use the function mysql_tquery, just mysql_query!
Reply
#5

ty :*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)