Welcome Guest, Not a member yet? Register   Sign In
display a single search result
#1

[eluser]face1m[/eluser]
I would like to do a simple query like:

$sql = " select count(*) from pball where pball <= 19";
$result = $this->db->query('$sql');
return $result;

than simple display the result in the view file like &lt;?php echo $result;?&gt;

I can't believe i can't figure this!

fustrated
#2

[eluser]aidehua[/eluser]
Try

Code:
$sql = ” select count(*) as my_count from pball where pball <= 19”;
$result = $this->db->query(’$sql’);
return $result;

then simple display the result in the view file like

Code:
&lt;?php echo $result->my_count;?&gt;
#3

[eluser]face1m[/eluser]
thanks for the quick reply... it works!!




Theme © iAndrew 2016 - Forum software by © MyBB