mysql doesnt insert information in sql - 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 doesnt insert information in sql (
/showthread.php?tid=646410)
mysql doesnt insert information in sql -
Foxer123456 - 16.12.2017
Hello guys, look i have some kinda of problem its like then i try to update some information when some server member want to put boxes in warehouses and information doesnt change. Example i have 150 ammo in my job warehouse i take some box and take it in designated place then i put box mysql should update information and add +150 ammo in sql base but nothing work

. Sorry for my bad english maybe you understand what i want to say.
my code:
Код HTML:
mysql_format(connectionHandle, query, 100, "UPDATE `mafijosammo` SET GpAmmoAK = '%d',GpAmmoDeagle = '%d',GpAmmoShotgun = '%d',GpAmmoAWP = '%d;", ARASSettings[GpAmmoAK], ARASSettings[GpAmmoDeagle], ARASSettings[GpAmmoShotgun], ARASSettings[GpAmmoAWP]);
mysql_function_query(connectionHandle,query,false,"SendQuery","");
Re: mysql doesnt insert information in sql -
Konstantinos - 16.12.2017
Error in syntax.
Код:
"UPDATE `mafijosammo` SET GpAmmoAK = '%d',GpAmmoDeagle = '%d',GpAmmoShotgun = '%d',GpAmmoAWP = '%d';"
Always check mysql debug/log if something is not inserted/updated. A better way if you are going to store more weapons is a child-table. Have a look here:
https://sampforum.blast.hk/showthread.php?tid=505081
Eventually upgrading to latest version of mysql is also recommended.
Last, enable cache even if it's an INSERT/UPDATE query.