Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update one column - Conditinally, update 2nd column. Can it be done?

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I am using PHP/MySQL. I have the following query:

Code:
$usql = 'UPDATE `productsd` SET 
pdQtyOnh = pdQtyOnh - ' . $qty . ' 
WHERE pdID = ' . $key . ' LIMIT 1;';

There is a second column named pdStatus. I would like to set status to "X" if column pdQtyOnh <= $qty.

How can I do this?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top