hep making mysql query
#1

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.
Reply
#2

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` <= 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)