You'll have to do it in 2 queries:
$result = mysql_query("SELECT something FROM shopping_cart_table WHERE prod_id = '$prod_id'");
//if rows are returned, then product
//exists in shopping cart already
if(mysql_num_rows($result))
{
$update = mysql_query("UPDATE shopping_cart_table SET quanitity=quantity+1 WHERE prod_id = '$prod_id'");
}
else
{
$insert = mysql_query("INSERT INTO shopping_cart_table (prod_id,quantity) VALUES ('$prod_id',1)");
}
That's not tested, but should work and give you an idea of what to do...
---John Holmes...