Is it safe to do what is below? deleting from a resultset while you are
processing it? I don't know how dynamic the SQL database is. I assume you
get a cursor to live dataset. Even if it is a cursor as opposed to a table,
will the cursor's integrity be ruined if the current record is deleted?
$q2=mysql_query ("SELECT * FROM table1 WHERE id1=5", $link);
while ($row2=mysql_fe tch_array($q2)) {
//do some stuff with resultset
mysql_query("DE LETE FROM table1 WHERE id1=5 AND id2=$row2[id2]", $link);
}
mysql_free_resu lt($q2);
processing it? I don't know how dynamic the SQL database is. I assume you
get a cursor to live dataset. Even if it is a cursor as opposed to a table,
will the cursor's integrity be ruined if the current record is deleted?
$q2=mysql_query ("SELECT * FROM table1 WHERE id1=5", $link);
while ($row2=mysql_fe tch_array($q2)) {
//do some stuff with resultset
mysql_query("DE LETE FROM table1 WHERE id1=5 AND id2=$row2[id2]", $link);
}
mysql_free_resu lt($q2);
Comment