Jump to content

Catchable fatal error: Object of class stdClass could not be converted to string


coder-x

Recommended Posts

need help it says theres something wrong on this line

 

}elseif (strtolower($match_fetch) != strtolower($username)){

 

can someone help me please it says this error

 

Catchable fatal error: Object of class stdClass could not be converted to string in line 122

What does $match_fetch and $username contain? One of them appears to be an object of type stdClass.

if (strip_tags($_POST['play_id']) && strip_tags($_POST['Submit'])){

$play_id=strip_tags($_POST['play_id']);

$match_info=mysql_query("SELECT * FROM matches WHERE id='$play_id'");

$num = mysql_num_rows($match_info);

$match_fetch=mysql_fetch_object($match_info);

if ($num == "0"){

echo "No such match.";

}elseif ($num != "0"){

if ($match_fetch->bet > $fetch->money){

echo "You Havn't Got Enough Money To Play.";

}elseif($match_fetch->bet <= $fetch->money){

if (strtolower($match_fetch->username) == strtolower($username)){

echo "You Cannot Have A Match Against Yourself!.";

}elseif (strtolower($match_fetch) != strtolower($username)){

$oppon = mysql_fetch_object(mysql_query("SELECT * FROM user_info WHERE username='$match_fetch->username'"));

$oppon_user = mysql_fetch_object(mysql_query("SELECT * FROM user_info WHERE username='$match_fetch->username'"));

$wl=explode(":",$oppon->wl);

 

 

thats all the code mate

$match_fetch is an object. Try....

 

} elseif (strtolower($match_fetch->username) != strtolower($username)){

 

And please, use


tags when posting code.

oh sorry im new here

btw i tried that never worked it was

}elseif (strtolower($match_fetch->match_fetch) != strtolower($username)){

it was match fetch

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.