How can use foreach to Loop Through PHP Array
- by jtom
How can use foreach loop to loop through the $Result?
$Query = mysql_query("SELECT * FROM mytable");
$Result = array( );
while ($Row = mysql_fetch_array ( $Query) ) {
$Result [ ] = $Row;
}
mysql_free_result($Query);
print_r ($Result);
?
I just have very vague idea:
foreach ($Result )
{
echo $row[fname] . ' ' . $row[lname] . ' ' $row[email];
}
?
Could someone help please?