Getting an error - Warning: mysql_fetch_array()
<pre><code>&lt;?php


$MemberDisplayList = '&lt;table border="0" align="center" cellpadding="6"&gt;
              &lt;tr&gt;  ';

$sql = mysql_query("SELECT id, firstname FROM myMembers WHERE email_activated='1' ORDER BY RAND() LIMIT 9");
while($row = mysql_fetch_array($sql)){
    $id = $row["id"];
    $firstname = $row["firstname"];
    $firstname = substr($firstname, 0, 10);

    $check_pic = "members/$id/image01.jpg";
    if (file_exists($check_pic)) {
        $user_pic = "&lt;img src=\"members/$id/image01.jpg\" width=\"64px\" border=\"0\" /&gt;";
    } else {
        $user_pic = "&lt;img src=\"members/0/image01.jpg\" width=\"64px\" border=\"0\" /&gt;";
    }
    $MemberDisplayList .= '&lt;td&gt;&lt;a href="profile.php?id=' . $id . '"&gt;&lt;font size="-2"&gt;' . $firstname . '&lt;/font&gt;&lt;/a&gt;&lt;br /&gt;
    &lt;div style=" height:64px; overflow:hidden;"&gt;&lt;a href="profile.php?id=' . $id . '"&gt;' . $user_pic . '&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;';

} 

$MemberDisplayList .= '              &lt;/tr&gt;
            &lt;/table&gt;  ';
?&gt;
</code></pre>

<p>there is coding for the connecting file the file name is <strong>connect_my_sql.php</strong> and the coding is </p>

<pre><code>&lt;?php
require_once('connect_my_sql.php'); 
while($row = mysql_fetch_array($sql))
$db_host = "localhost";
$db_username = "amirato"; 
$db_pass = "gapa";
$db_name = "rato";
mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
mysql_select_db("$db_name") or die ("no database");
?&gt;
</code></pre>

<p>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\PhpProject4\homePage_randomMembers.php on line 3</p>
