I'm wanting some way to loop through the rows of a mysql result set and selectively delete certain rows. Can anyone help?
For example:
$res = mysql_query($query, $db);
while ($row = mysql_fetch_assoc($res)) {
if ($row['value'] == "something") {
// Some code to delete this row from the mysql result set?
} }
I'm wanting to use this code to filter out search results in a user database. For example, before I run mysql_num_rows on the result set I might want to delete rows of users who are under 13 years of age so I could then give you the number of users over 13. I know I could perform this particular example with a more precise SELECT operation (WHERE userage > 13) but I'm needing to filter results in much more complex ways that are beyond the scope of MySQL.
Thank you for your time and consideration...