select (a & 1) as newBoolField from table where yada yada limit. I think you want to update select result, not DB table row, is that right?
if you want update DB row, can use Insert into table (boolField) select newBoolValue from table where id = rowID ON DUPLICATE KEY UPDATE boolField=newBoolValue regards, anru On Sat, Jan 17, 2009 at 11:47 PM, Michael <[email protected]> wrote: > > I want to do a SELECT and UPDATE in one statement. > > Ie: I want to SELECT a single record: > > $result1 = mysqli_query($link,"SELECT a,b,c FROM table WHERE yada yada LIMIT > 1").... > > AND I want to UPDATE a bool field in the result that it has selected. > > The table has a PRIMARY AUTO increment field called 'id'. > > Thanks in anticipation. > > Michael > > > > --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
