Dynadot โ€” .com Registration $8.99

"Catchable fatal error"

Spaceship Spaceship
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
It could help if you post the lines before and after, and maybe the strtolower function.
 
0
•••
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
•••
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
•••
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
•••
thanks a bunch!! it worked :D
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back