i'm working on a shopping cart system and i have finished most of the main stuff. i just have a few dumb details left. the product is one that is unique in that each time an item is purchased, it must be deleted from the product database(mysql). the only way i can think to do this is with a while loop and a mysql query (which won't work). please help in an alternative method to deleting all products with a unique product id each time one is purchased. for some help, here is my while loop (i know you can't run a query in a while loop):
while($row = mysql_fetch_array($cart_result)) {
$sel_item_id = $row["sel_item_id"];
$rm_product_sql = "DELETE FROM products WHERE id = \"$sel_item_id\"";
mysql_query($rm_prodcut_sql) or die("Couldn't delete products.");
}