[SOLVED] simple db retrieval
Posted: Thu Jun 24, 2004 6:08 pm
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
in this code 3 rows should show up but im getting only 1...
Code: Select all
// 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]);
}