How can use foreach loop to loop through the $Result?
<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error());
mysql_select_db("mydb");
$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:
<?php
foreach ($Result )
{
echo $row[fname] . ' ' . $row[lname] . ' ' $row[email];
}
?>
Could someone help please?