Categories
Mastering Development

Update multiple table fields inside a while loop wont work

$sql = "SELECT * FROM enginetech_pricing";

$result = $conn->query($sql);

while($row  = $result->fetch_assoc()) {

$pic = $row["part_number"];

$part_price = $row_orders["pricing"]; 

$update = "UPDATE parts SET sell_price='$part_price' WHERE pic='$pic'";
} 

if ($conn->query($update) === TRUE) {

echo 'Success';

}

Leave a Reply

Your email address will not be published. Required fields are marked *