Welcome Guest, Not a member yet? Register   Sign In
Call to a member function row() on a non-object
#1

[eluser]stephencoverdale[/eluser]
Hi All,

I get this error -

PHP Fatal error: Call to a member function row() on a non-object in /var/www/application/controllers/site.php on line 32

Here is the code

Code:
function scorecalc(){
  $this->load->model("get_db");
  $data['fbid'] = $this->get_db->getFBID();
  foreach($data['fbid'] as $row){
   $fbid = $row->fb_id;
  $fbquery = $this->get_db->getFB($fbid);
  $row = $fbquery->row();
  $likes = $row->total_page_like;
  $talkingabout = $row->talking_about_count;
  $werehere = $row->were_here_count;
  $score = $likes+$talkingabout+$werehere;
  echo $score;
  
  
  }

I did a var_dump and got the following results

array(1) { [0]=> object(stdClass)#22 (3) { ["total_page_like"]=> string(2) "43" ["talking_about_count"]=> string(1) "6" ["were_here_count"]=> string(3) "899" } }

Was wondering if anyone could see what was going on.

Thanks,
Steve


Messages In This Thread
Call to a member function row() on a non-object - by El Forum - 12-08-2012, 01:53 AM
Call to a member function row() on a non-object - by El Forum - 12-08-2012, 02:06 AM
Call to a member function row() on a non-object - by El Forum - 12-08-2012, 11:54 AM
Call to a member function row() on a non-object - by El Forum - 12-08-2012, 12:39 PM
Call to a member function row() on a non-object - by El Forum - 12-08-2012, 08:27 PM
Call to a member function row() on a non-object - by El Forum - 12-08-2012, 10:44 PM
Call to a member function row() on a non-object - by El Forum - 12-11-2012, 10:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB