Page 1 of 1

Reset Game

Posted: Mon Jun 16, 2014 10:15 pm
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

Re: Reset Game

Posted: Tue Jun 17, 2014 1:51 am
by Callan S.
I'm just guessing, but shouldn't that be '==' rather than just '='?

Re: Reset Game

Posted: Tue Jun 17, 2014 6:46 pm
by cyborg
That didn't work. I remember now that was abit of code I was experimenting with, Thought I removed it. Thanks though

Re: Reset Game

Posted: Wed Jun 18, 2014 2:29 pm
by hallsofvallhalla
echo out $search and see what it looks like.