SA-MP Forums Archive
hep making mysql query - 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: hep making mysql query (/showthread.php?tid=312713)



hep making mysql query - ajwar - 22.01.2012

Hi, i tryed to make mysql query which:

Checks if 'volt' = 1 ant if that than it decrease's `voltcount` by 1. And the last check if `voltcount` <= 0 than 'volt' = 0

but it's just not working. May anyone generate such query? If you can't write a code give an example of codes i should use. Thanks.


Re: hep making mysql query - Sinner - 22.01.2012

First query:
PHP код:
// Sets voltcount to voltcount - 1 where volt = 1
UPDATE `TABLE_NAMESET `voltcount` = `voltcount` - 1 WHERE `volt` = 
Second one:
PHP код:
// Sets volt to 0 where voltcount <= 0
UPDATE `TABLE_NAMESET `volt` = 0 WHERE `voltcount` <=