• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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!!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.