I have to do a first query which is SELECT * from table WHERE NOT column=0, and use the results from that to do a foreach loop something like below.
foreach($results as $result) {
$nox = $result[field_x];
//Use nox for whatever;
//Then update some fields in SQL; }
And keep doing that until all the items in the first query are done.
What would the syntax be?