Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

"Catchable fatal error"

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Mike_Wiseman

Established Member
Impact
3
Hey everyone,

I am working on a script i purchased and there seems to be a bug with the "arm wrestling" page (yea its kinda cheesy).

Here is the error:

Catchable fatal error: Object of class stdClass could not be converted to string in /home/mafiamay/public_html/arm.php on line 111

and here is line 111 on arm.php:

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

if you need anymore info just ask.

Thanks
Mike_Wiseman
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
It could help if you post the lines before and after, and maybe the strtolower function.
 
0
Close
Code:
if (strtolower($match_fetch->username) == strtolower($username)){
echo "You cannot play yourself sado.";
}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 users WHERE username='$match_fetch->username'"));
$wl=explode(":",$oppon->wl);
 
0
Close
Your first code example has
PHP:
strtolower($match_fetch)
But the second has
PHP:
strtolower($match_fetch->username)

Which is actually in the code?

The reason I ask is that the second example should fix the problem in the first. strtolower($match_fetch) is trying to print a class as a string, but the class has no string representation. You could add one, but I don't think that's what you really want.

The second code snippet actually looks correct, and looks like it should work.

So which is it?
 
0
Close
As cef said, try this:

Code:
if (strtolower($match_fetch->username) == strtolower($username)){
echo "You cannot play yourself sado.";
}elseif (strtolower($match_fetch->username) != 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 users WHERE username='$match_fetch->username'"));
$wl=explode(":",$oppon->wl);
 
0
Close
thanks a bunch!! it worked :D
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back