Im trying to update a field in my table (specifically the price field) where i choose the price i wish to change, and wherever there is an instance of that price in a table it will change to the new price. This is what i have so far, but it is not working:
(for example, ill just hard code the variables)
$oldprice = 9.99
$newprice = 5.99
here is my sql statement:
$sql = "update product_table
set
product_price=$newprice
where product_price = $oldprice
";
$result = @($sql,$db)or die("Couldn't execute query.");
i echo my $sql statement and it looks like this:
update product_table set product_price=5.99 where product_price = 9.99
But all instances of the 9.99 price still remain..
What am i doing wrong???
ps, if it matters the field product_price is of float type 5,2