jack bro Posted March 31, 2009 Share Posted March 31, 2009 In my game you can post a boxing challenging and if another player accepts you fight. When you go to accept a challenge I get this error. Catchable fatal error: Object of class stdClass could not be converted to string in /home/thebestj/public_html/arm.php on line 114 Line 114 of arm.php is }elseif (strtolower($match_fetch) != strtolower($username)){ Any help would be apprechiated. Jack. Quote Link to comment https://forums.phpfreaks.com/topic/151965-catchable-fatal-error/ Share on other sites More sharing options...
Maq Posted March 31, 2009 Share Posted March 31, 2009 How is $match_fetch created? We may need to see some surrounding code, but not the entire thing. Quote Link to comment https://forums.phpfreaks.com/topic/151965-catchable-fatal-error/#findComment-798010 Share on other sites More sharing options...
lostnucleus Posted March 31, 2009 Share Posted March 31, 2009 if $match_fetch is an instance of stdClass , then check stdClass uses magic public function __tostring() ...... Quote Link to comment https://forums.phpfreaks.com/topic/151965-catchable-fatal-error/#findComment-798012 Share on other sites More sharing options...
jack bro Posted March 31, 2009 Author Share Posted March 31, 2009 $match_fetch=mysql_fetch_object($match_info); Quote Link to comment https://forums.phpfreaks.com/topic/151965-catchable-fatal-error/#findComment-798015 Share on other sites More sharing options...
Maq Posted March 31, 2009 Share Posted March 31, 2009 You should be using something like this: }elseif (strtolower($match_fetch->column_name) != strtolower($username)){ Quote Link to comment https://forums.phpfreaks.com/topic/151965-catchable-fatal-error/#findComment-798021 Share on other sites More sharing options...
jack bro Posted March 31, 2009 Author Share Posted March 31, 2009 Changed to: }elseif (strtolower($match_fetch->column_name) != strtolower($username)){ and still same error. Jack. Quote Link to comment https://forums.phpfreaks.com/topic/151965-catchable-fatal-error/#findComment-798029 Share on other sites More sharing options...
Maq Posted March 31, 2009 Share Posted March 31, 2009 "column_name" is the column you're extracting from the database... Right now you're trying to use a function that takes a parameter of a string and give it a resource. Quote Link to comment https://forums.phpfreaks.com/topic/151965-catchable-fatal-error/#findComment-798039 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.