Jump to content

Archived

This topic is now archived and is closed to further replies.

kickassamd

Array headaches

Recommended Posts

[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...

Share this post


Link to post
Share on other sites

×

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.