I'm trying to figure out how to modify data I copy from one table into another two.
Currently I have it working so my form submits it pulls the data from 'prices' and puts it into 'pricestwo' and 'pricesthree'.
However I need to modify the data before hand to make one 10% less on price, and one 20% less on price.
<?php
$priceid = $_POST['priceid'] ;
$name = $_POST['productname'] ;
$weight = $_POST['productweight'];
$price = $_POST['productprice'];
if(isset($_POST['updateprices'])) {
for($i=0;$i<$count;$i++){
$sql1= mysqli_query($myConnection, "UPDATE pricestwo SET productname='$name[$i]', productweight='$weight[$i]', productprice='$pricetwo[$i]' WHERE priceid='$priceid[$i]'");
$sql2= mysqli_query($myConnection, "UPDATE pricesthree SET productname='$name[$i]', productweight='$weight[$i]', productprice='$price[$i]' WHERE priceid='$priceid[$i]'");
}
echo "<meta http-equiv=\"refresh\" content=\"0;URL=edit_product_prices.php\">";
}
?>
This currently works to copy just the data, I've tried something like:
$pricetwo = $price - ($price * 0.15);
to modify the data, but there are multiple rows been transferred so this just returns a 0.00 value.
Anyone have any ideas on how to do this?