Jump to content

[SOLVED] Foreach error.


clanstyles

Recommended Posts

function checkRank($reqRank)
{
	$id = $_SESSION['id'];
	$result = mysql_query("SELECT * FROM `acc_ranks` WHERE `userid`=$id");
	$rankList = Array();
	while($res = mysql_fetch_array($result))
	{
		$rankList = $res['rankid'];
	}

	foreach($rankList as $value)
	{
		if($value == $reqRank)
		{
			return true;
		}
	}
	return false;
}

 

Whats wrong w/ that?

 

Warning: Invalid argument supplied for foreach() in /xxxxxxxxxxxxxxxxxxxxxxxxxxx on line 41

 

Link to comment
https://forums.phpfreaks.com/topic/58800-solved-foreach-error/
Share on other sites

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.