hi! i'm having a hard time figuring out how to add two values(numbers) retrieved from a table. They should be added and displayed. how can i do this?
here's the code snippet:
require('connect.php');
$result = mysql_query("SELECT * FROM `order` where date = '$date' ");
while ($row = mysql_fetch_array($result)){
echo "The product Code: {$row['product_code']} <br>
had been sold {$row['quantity']} times <br>
and the total price is {$row['total_price']}.
Report from : {$row['date2']}";
}
when I try : $price = $row['total_price'] + $row['total_price']
, the value returned is 0
. Same goes if I try adding the quantity. Help?