Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Fatal Error: Call to a member function on a non-object
Old 06-30-2008, 06:17 PM Fatal Error: Call to a member function on a non-object
Junior Talker

Posts: 1
Name: James
Trades: 0
Error:Fatal error: Call to a member function add_student() on a non-object in /var/www/21centdata.com/htdocs/v2_06/report_meeting_goal.php on line 45

I'm getting an error on the $student value below, I'm assuming it's because the value is empty... I'm I getting warming?

I appreciate any responses, I spend most of my day munging Coldfusion...

function &get_results($YEAR, $last_day, $target, $site_id, $mysql, $site_name){
$site =& new Site($site_name, 'Site');;
$students = get_students($YEAR, $last_day, $target, $site_id, $mysql);
add_grades($site, $YEAR, $site_id,$mysql);

foreach($students as $student){
if($student->site == $site_name){
$site->complete_grades[$student->grade]->add_student($student);// This is the line throwing the error...
}
}
propagate_aggregates($site);
return $site;
}
westfork is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-01-2008, 04:44 PM Re: Fatal Error: Call to a member function on a non-object
coldwind's Avatar
Novice Talker

Posts: 12
Name: Konstantin Leboev
Trades: 0
It means that

PHP Code:
$site->complete_grades[$student->grade
is not an object.

It could be becouse of:
a) there is no key $student->grade in array $site->complete_grades or it is not an object
b) $site->complete_grades is not an array

Try to var_dump your variables to find out your bug.
coldwind is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Fatal Error: Call to a member function on a non-object
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16789 seconds with 12 queries