Difference between mysql_fetch_array() vs mysql_fetch_assoc()
mysql_fetch_array()
$rows = mysql_fetch_array( "select name, address from people");
Means you then get each of the row results as a straight array, meaning you dont necessarily need to know in advance the order elements arrive via the select.
foreach( $rows as $row )
echo $row[0] . ' lives at ' . $row[1] ;.
$rows = mysql_fetch_assoc()
$rows = mysql_fetch_assoc( "select name, address from people" );
Means you then get each of the row results as a named array elements, an associative array.
foreach( $rows as $row )
echo $row['name'] . ' lives at ' . $row['address'];
Which is now dependent on you knowing what the result columns are named.