Reset Game

General Chat, Comments
Post Reply
cyborg
Posts: 38
Joined: Mon Feb 03, 2014 11:09 am

Reset Game

Post by cyborg »

I finally got back working on my game, and I reset my game. oddly enough to find any errors in the code I had recently done.

I got the following error which was wasn't expect with the original code

Code: Select all

Error: mysql_fetch_assoc() expects parameter 1 to be resource, object given
Error in ../modules/stats/auto_post_content.php
Line 32
Error in ..\modules\stats\auto_post_content.php
Line 32
The code is from 25.

Code: Select all

echo "<span class='userBox' onclick=\"document.location='index.php?p=view_player&id=$userId'\">$username [$userId]</span>";
$search = $db->Execute("select user_stats.*,user_stat_types.*
				from user_stats
				left join user_stat_types
				on user_stat_types.id=user_stats.stat_type where user_id = ? Order by id DESC", $userId);
	if ($search->EOF)	

	while ($row = mysql_fetch_assoc($search)) {
    echo $row[1][5];
}
$search->Close();
Line 32

Code: Select all

while ($row = mysql_fetch_assoc($search)) {
Is it because the if statement is missing an else condition?

Thanks in advance
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: Reset Game

Post by Callan S. »

I'm just guessing, but shouldn't that be '==' rather than just '='?
cyborg
Posts: 38
Joined: Mon Feb 03, 2014 11:09 am

Re: Reset Game

Post by cyborg »

That didn't work. I remember now that was abit of code I was experimenting with, Thought I removed it. Thanks though
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: Reset Game

Post by hallsofvallhalla »

echo out $search and see what it looks like.
Post Reply

Return to “General”