Page 1 of 1

Displaying the variable name in the results

Posted: Wed Oct 15, 2008 6:09 am
by dthomas31uk
Hi. Have the following code it all works, but the actual result is displaying the name of the table in the results when I echo it. Is there a way of calculating the result first in a variable and then echoing the result in the variable. Sorry am new to all this. have tried
$result=$row['full_price'];
echo $result;
but no joy

Code: Select all

if ($load == 'full_load') {
  echo (" "). $row['full_price'];
} else {
  echo (" "). $row['half_price'];
}
 

Re: Displaying the variable name in the results

Posted: Wed Oct 15, 2008 6:13 am
by dthomas31uk
The result shows the following

Value of $load = full_load 100

full_load being the name of the field and the total 100. I dont want to show the name of the field in the result

Re: Displaying the variable name in the results

Posted: Wed Oct 15, 2008 6:19 am
by dthomas31uk
Have got it working guys cheers

Re: Displaying the variable name in the results

Posted: Wed Oct 15, 2008 6:21 am
by aceconcepts
Show your query