kickassamd Posted July 25, 2006 Share Posted July 25, 2006 [code]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);[/code]when i echo the $user array i get[quote]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 ) )[/quote]which is ok...but when i print_r($user2) i get[quote]Array ( [0] => 1 [1] => 1 [2] => 4 [3] => 22 [4] => 45 ) [/quote]Why is coming up with 2 1's that is what i dont get... Quote Link to comment https://forums.phpfreaks.com/topic/15565-array-headaches/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.