MySQL Forums
Forum List  »  PHP

deleting rows in a while reading loop in the same table
Posted by: Pierre-Yves Michaud
Date: February 20, 2006 10:45AM

I want to be sure that the following is correct

$sqlov = "select * from ordres_ventes ORDER BY prix ASC";
$reqov = mysql_query($sqlov) or die('Erreur SQL !');
while($data_ov = mysql_fetch_array($reqov))
{
if (xxxx)
mysql_query("DELETE FROM ordres_ventes WHERE id='$id_offre_vente'");}
else
mysql_query("Update ordres_ventes Set nb='$reste_qte_a_vendre' WHERE id='$id_offre_vente'");
}

can i get troubles deleting rows in the same table that i am currently reading?

Thanks in advance for the answers
Pierre-Yves

Options: ReplyQuote


Subject
Written By
Posted
deleting rows in a while reading loop in the same table
February 20, 2006 10:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.