hey mate...well because they are non-numerical arrays it works with assoc
as i showed u before....with the for loop
i have this now
while ($row_top = mysqli_fetch_assoc($res_top))
{
$countTop = count($topics);
$topics[$row_top['top_id']] = $row_top['max_stud'];
}
print_r($topics);
which prints the following:
[111] => 2
[112] => 3
[113] => 2
[114] => 3
[115] => 1
[116] => 3
[117] => 1
[118] => 1
[119] => 1
this is what i want.....
the strange thing is that when i do the following there is no print out
do u perphaps know why?
for ($j = 0; $j < $countTop; $j++)
{
if($topics[$j] != 0)
{
echo 'yes';
}
}
countTop is the counter of the array elements