SA-MP Forums Archive
Sql problem. - 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: Sql problem. (/showthread.php?tid=640258)



Sql problem. - Develerux - 30.08.2017

I have the problem with sql update.

[18:54:36] [plugins/mysql] error #1054 while executing query "UPDATE `characters` SET `skin`=`295`,`score`=`11`,`fegyvereng`=`1`,`jogosi tvanyA`=`1`,`jogositvanyB`=`1`,`jogositvanyC`=`1`, `jogositvanyD`=`1`,`jogositvanyE`=`1`,`health`=`10 0.000000`,`armour`=`50.000000`,`money`=`500000`,`P osX`=`153.429108`,`PosY`=`-1952.186157`,`PosZ`=`47.875000`,`PosA`=`114.069725 `,`world`=`7269`,`interior`=`0`,`admin`=`5`,`aname `=`Memphis`,`vip`=`1`,`donator`=`1`,`jailtype`=`1` ,`jailtime`=`135`,`jailreason`=`Tesztelйs kйppen.`,`jailby`=`Cameron Marshall`,`frakcioid`=`0`,`workid`=`0`,`paydaytime `=`0`,`enablepm`=`1` WHERE `name`=`Cameron_Marshall`": Unknown column 'Cameron_Marshall' in 'where clause'
[18:54:36] [log-core] exception 0XC0000005 (ACCESS_VIOLATION) from Vectored Exception Handler catched; shutting log-core down


Re: Sql problem. - Vince - 30.08.2017

Do you really need to update all of this information? The answer is: no, you don't. Update stuff as it changes. Write shorter queries instead of this monstrosity. How often does admin level change? Only by command, right? Then update it in the command and not anywhere else. Same goes for vip, donator, jail stuff and pretty much everything else.

As for your actual problem, learn the difference between quotes. The backtick (`) denotes an identifier (column name or table name), the normal quote (') denotes a value.


Re: Sql problem. - Misiur - 30.08.2017

You used backticks ` when you shuould have used quotes ', around every parameter


Re: Sql problem. - Develerux - 30.08.2017

Really thanks guys.


Re: Sql problem. - Develerux - 30.08.2017

One more question Vince. How often repeat the save timer on server close 100-150 player? Of course not to become lag server because save timer.


Re: Sql problem. - Vince - 30.08.2017

If you update stuff as it changes then you don't need a "save timer" at all.


Re: Sql problem. - Develerux - 31.08.2017

Yeah but what about player coordinates? Save player coords when player disconnect, its alright. But what happened when server is timed out? OnPlayerDisconnect it does not run. I do not want to put update stuff to OnPlayerUpdate. Or I trust that it will not timed out the server?


Re: Sql problem. - Luke_James - 31.08.2017

Your server shouldn't crash frequently enough for that to be a problem... if it is, there's something seriously wrong. If your server / a player crashes, he will return to the last saved position.