SA-MP Forums Archive
Mysql Error - 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: Mysql Error (/showthread.php?tid=575953)



Mysql Error - Dominic123 - 31.05.2015

I have a problem in my SQL code,can you help me,please?
Код:
		new Query[ 3000 ], sendername[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        GetPlayerName(id, playername, sizeof(playername));
        format( Query, sizeof( Query ), "INSERT INFO `fines` (Politist, Pret, Pentru, Posesor) VALUES('%s', '%d', '%s', '%s')",
		playername, price, reason, sendername);
        mysql_query( Query );
Quote:

[22:54:17] MySQL Error (0): Could not execute query. 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 '`fines` (Politist, Pret, Pentru, Posesor) VALUES('Beltramo_Cusimano', '0', 'test' at line 1.




Re: Mysql Error - MEW273 - 31.05.2015

Hi Dominic123,

Try changing:
Код:
INSERT INFO `fines` (Politist, Pret, Pentru, Posesor) VALUES('%s', '%d', '%s', '%s')
to:
Код:
INSERT INTO `fines` (Politist, Pret, Pentru, Posesor) VALUES('%s', '%d', '%s', '%s')



Re: Mysql Error - Dominic123 - 31.05.2015

LOL xd,i don't see INFO,thank you dude.