Hey all;
I've been looking everywhere and can't seem to find the solution. Can someone tell me why this code doesn't work? The mysql_num_rows() returns the correct number of rows (say 3 are returned), but the foreach loop only ever iterates once and only shows the me the first record returned.
Going crazy...any ideas?
=======================
function selectRows($tableToView){
$recQuery = "SELECT * FROM ".$tableToView;
$recResult = mysql_query($recQuery)
or die ("Couldn't access table ".$tableToView);
$recRow = mysql_fetch_array($recResult);
echo "Rows: ".mysql_num_rows($recResult)."<BR>\n";
foreach($recRow as $colName => $colData){
echo $colName."---->".$colData."<BR>\n";}
}
Thanks!
Jon