Currently i've got this code:
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { if (!empty($row['OneDel1'])){ $OneDel1 == 1; } }
How would I go about replacing the if statement with a foreach statement that cycles through a number of columns from the database? Basically a shorter way of:
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { if (!empty($row['OneDel1'])){ $OneDel1 == 1; } if (!empty($row['OneDel2'])){ $OneDel2 == 1; } if (!empty($row['OneDel3'])){ $OneDel3 == 1; } if (!empty($row['OneDel4'])){ $OneDel4 == 1; } }
And so on?
Thanks in advanced!