Adding together two values from my sql queries
Posted: Wed Oct 15, 2008 3:28 am
Hi. Am having trouble adding together two values that are stored in two sql queries.
The values are stored in variables but cannot get it to calulate and display on my webpage
And the code I have tried to use to calculate the values is
but just get a blank screen. Any ideas guys
The values are stored in variables but cannot get it to calulate and display on my webpage
Code: Select all
$result = mysql_query("SELECT full_price, half_price FROM eu_place WHERE city = '" . mysql_real_escape_string($subcat) . "'") or die(mysql_error());
$row = mysql_fetch_array($result);
if ($load == 'full_load') {
echo (" "). $row['full_price'];
} else {
echo (" "). $row['half_price'];
}
$resultPickup = mysql_query("SELECT price FROM uk_place WHERE city = '" . mysql_real_escape_string($pickup) . "'") or die(mysql_error());
$rowPickup = mysql_fetch_array($resultPickup);Code: Select all
echo $rowPickup + $row['full_price'] ;