Page 1 of 1

Question on UPDATE

Posted: Thu Jan 12, 2006 2:06 pm
by dwessell
Hi all..

Code: Select all

"UPDATE `ItemInformation` SET `LastItem` = 0, `ItemUsed` = 0 WHERE `GameNumber` = $row[0] AND `TeamNumber` = $row[1] AND `LastItem` = 1";

With this code, it's updating `LastItem`, but not `ItemUsed`. Is that becuse I have one of the conditions as `LastItem` = 1. And when that changes to 0, it's no longer true?

Thanks
David

Posted: Fri Jan 13, 2006 6:24 am
by JayBird
Im not entirely sure about this, but try switching the order in your query

Code: Select all

"UPDATE `ItemInformation` SET `ItemUsed` = 0, `LastItem` = 0 WHERE `GameNumber` = $row[0] AND `TeamNumber` = $row[1] AND `LastItem` = 1";

Posted: Fri Jan 13, 2006 7:26 am
by dwessell
Hey Pimptastic..

I surely did, but to no avail. The critera are being met, thus the one column being changed.. But I'm at a loss as to why that other column isn't changing too.. I've verified that the column name is correct, it's a TinyInt, so a 0 shouldn't throw it off..

Truely stumped.. :)

Thanks
David