Hello,
Please be soft on me, I try to learn… ;D
But this is an obstacle I can not get over alone and google doesn’t help/
I’m trying to get my price calculated en used in an update query.
I use:
price_adv (advice price)
price (customer price)
discount (I use a percentage like 4,6, 10 ….)
Normally I would use something like (price_adv / 100) * (100 – discount)
WHERE and how do I implement this is this code ?!?!?
[php]Update multiple rows in mysql
|
// Check if button name “Submit” is active, do this
if ($Submit){
for($i=0;$i<$count;$i++)
{
// $sql1="UPDATE Prod SET model= '$model[$i]', price_adv='$price_adv[$i]' ,price=($price_adv[$i] / 100) * (100 - $discount[$i]) , discount='$discount[$i]' WHERE id='$id[$i]' ";
$sql1="UPDATE Prod SET model= '$model[$i]', price_adv='$price_adv[$i]' , price='[$price[$i]' , discount='$discount[$i]' WHERE id='$id[$i]' ";
$result1=mysql_query($sql1);
}
}
if($result1){
header(“location:price.php”);
}
mysql_close();
?>[/php]
Thanks,
Rob