Is it possible to do an update on a table while you're in the middle of quering it?
Simplified example:
table has 3 fields: city, color, number
there are multiple records with the same city
$get = db_query( "select * from table_colors where city=$city);
while ( $stuff = db_fetch_array($get) )
{
//check color
if ( $stuff["color"] == "red" )
{
//update number
$update = db_query("update table_colors set number=1 where city=$city" );
}
}
of course, this is not the exact code I'm using and there are tons and tons more stuff in between such as it would check if number was not already 1, but this is wimple enough to carry my point
What I'm doing here is updating that same table that I'm querying in the while lopp, but it's not the same filed taht I'm using as the "where" clause.
Thanks