hello blog The mysql_fetch_row() function returns a row from a recordset as a numeric array.
To get the value from the array we have to use array offset staring from 0. Each call to this mysql_fetch_row function returns the next record. Here one record is returned at a time and returns false if there is no more record to return. So we can easily use this function inside a while loop and display all the records. Each time at the starting of the while loop the mysql_fetch_row() function is checked and if true then the loop is executed and the records are displayed. Here is one example and we have used our student table for this.
<?
$query=mysql_quer y("select * from student");
echo mysql_error();
echo "<b>id,name,class,mark</b><br> ";
while($nt=mysql_fetch_row( $query)){
echo "$nt[0],$nt[1],$nt[2],$nt[3] <br>";
}
?>
Answered by
raj u
, an ibibo Master,
at
12:27 PM on May 23, 2008