I'm trying to fetch data and display it via foreach loop but it's not working giving argument error but when i try this with while loop it's work fine. so my question is that why i cannot fetch data using mysqli_fetch_array with foreach why it's only possible with while loop
// While
while($row = mysqli_fetch_row($result))
{
var_dump($row); echo "<hr />";
}
// Foreach
foreach(mysqli_fetch_array($result) as $row)
{
var_dump($row); echo "<hr />";
}
whilewill continually invoke the the function, theforeachwill not