PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi, i cant seem to find the error in this code--this is a simple database retrival and instead of getting 3 rows(the amount of rows in the database), i get one
// GENERATE A LIST OF CATEGORIES INTO AN ARRAY
$query_cat_list = "SELECT c_name FROM category";
$result_cat_list = mysql_query($query_cat_list);
//GENERATE THE ROWS
for ($i = 0; $i < mysql_num_rows($result_cat_list); $i++) {
$rowarray_cat_list = mysql_fetch_array($result_cat_list);
echo ($rowarray_cat_list[$i]);
}
in this code 3 rows should show up but im getting only 1...