I am aware of two basic ways of returning data from a database. The method I prefer is:
mysql_select_db(%database info%);
$query="SELECT * FROM table");
$results=mysql_query($query);
$numrows=mysql_num_rows($results);
for ($i=0;$i<$numrows;$i++) {
$pName = mysql_result($reuslts,0,"Name");
echo $pName;
}
The other is with
$row_results=mysql_fetch_assoc($results);
and using
echo $row_results['ID']
My question...which is faster and which is better...more correct.