Php - Fetch mysql rows recursively in array, Using while loop and recursive array

Fetch mysql rows recursively in array

How to fetch mysql database rows using while loop recursively in an array?

 function fetchArray(){
 $qry = "select name,age from employee";
 $res = mysql_query($qry);
 while($row[]=@mysql_fetch_array($res));
 $row = @array_filter($row);
 }

We can now use :
 
 $employee_array = fetchArray();
 
 foreach($employee_array as $employee){
 echo $employee[0]['name'].' : '.$employee[0]['age'].'';
 }

The topic on Php - Fetch mysql rows recursively in array is posted by - Math

Hope you have enjoyed, Php - Fetch mysql rows recursively in arrayThanks for your time

Tech Bluff