Array number crops value instead of choosing key?
Posted: Fri Nov 07, 2008 2:06 pm
I'm simply trying to echo a column of numbers that are fetched from a database. The problem is that when I attempt to select a key from the array ($row_test['game_cat_idx_game_cat_id'][$i]) it ends up cropping the item instead of choosing the key to echo. I always encounter this issue so an explanation would be greatly appreciated. 
Code: Select all
$test = mysql_query("SELECT game_cat_idx_game_cat_id FROM game_cat_idx WHERE game_cat_idx_game_id ='39'");
$row_test = mysql_fetch_array($result4);
/*
20
24
19
16
15
*/
$count = mysql_num_rows($test); //5
echo 'count == '.$count;
while ($i < $count) {echo '<div>== '.$row_test['game_cat_idx_game_cat_id'][$i].'</div>'; $i++;}
/*
This echos...
== 2
== 0
==
==
==
==
==
When I want it to echo...
== 20
== 24
== 19
== 16
== 15
*/