Guest User

Untitled

a guest
Jun 24th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. My model:
  2. function wait_count()
  3.         {
  4.                 $query_str = "select * from wait";
  5.                 $q = $this->db->query($query_str);
  6.  
  7.                 if($q->num_rows() > 0)
  8.                 {
  9.                         foreach($q->result() as $wait)
  10.                         {
  11.                                 $data[] = $wait;
  12.                         }
  13.                         return $data;
  14.                 }
  15.         }
  16. My controller:
  17.  $data['wait_count'] = $this->home_model->wait_count();
  18. My view:
  19. <? foreach($wait_count as $count): ?>
  20. *** None of these work.
  21.         <? echo $count->num_rows(); ?>
  22.     <? echo $wait_count->num_rows(); ?>
  23. <? endforeach; ?>
Add Comment
Please, Sign In to add comment