Use mysql_fetch_array() with foreach() instead of while()
<p>i want to know how do we convert the following code to work with foreach</p>

<pre><code>$query_select = "SELECT * FROM shouts ORDER BY id DESC LIMIT 8;"; 

    $result_select = mysql_query($query_select) or die(mysql_error());

    while($row = mysql_fetch_array($result_select)) {
        $ename = stripslashes($row['name']);
        $eemail = stripcslashes($row['email']);
        $epost = stripslashes($row['post']);
        $eid = $row['id'];

        $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5(strtolower($eemail))."&amp;size=70";

        echo ('&lt;img src = "' . $grav_url . '" alt="Gravatar"&gt;'.'&lt;br/&gt;');

        echo $eid . '&lt;br/&gt;';

        echo $ename . '&lt;br/&gt;';

        echo $eemail . '&lt;br/&gt;';

        echo $epost . '&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;';
</code></pre>
