Jump to content


Photo

Array headaches


  • Please log in to reply
No replies to this topic

#1 kickassamd

kickassamd
  • Members
  • PipPipPip
  • Advanced Member
  • 102 posts
  • LocationDallas Tx

Posted 25 July 2006 - 09:18 AM

foreach ($xoopsModuleConfig['groups_display'] as $group => $key)
{
	$sql = "SELECT `uid` FROM `".$xoopsDB->prefix('groups_users_link')."` WHERE `groupid` = '$key'";
	$result = $xoopsDB->query($sql);
	while($uid = mysql_fetch_array($result)) 
	{
		$user[] = $uid;
	}

	for ($i = 0; $i < count($user)-1+1; $i++)
	{
		$user2[] = $user[$i]['uid'];
	}
}

print_r($user);

when i echo the $user array i get

Array ( [0] => Array ( [0] => 1 [uid] => 1 ) [1] => Array ( [0] => 4 [uid] => 4 ) [2] => Array ( [0] => 22 [uid] => 22 ) [3] => Array ( [0] => 45 [uid] => 45 ) )


which is ok...but when i print_r($user2) i get

Array ( [0] => 1 [1] => 1 [2] => 4 [3] => 22 [4] => 45 )


Why is coming up with 2  1's that is what i dont get...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users