php mysql fetch array
<p>i am trying to fetch data from database but
i keep getting the following message
 Warning: mysql_fetch_array() expects parameter 1 to be resource,
boolean given in C:\xampp\htdocs\sss.php on line 6</p>

<p>But when i check the code i can't see what is wrong...
CODE :</p>

<p>

<pre><code>$conn = mysql_connect("localhost","","");
mysql_select_db("database2",$conn);
$sql = mysql_query("SELECT * FROM table1");
while($result = mysql_fetch_array($sql))
{
echo " &lt;b&gt;id&lt;/b&gt; = " .$result["id"] . " &lt;br&gt;";
echo " &lt;b&gt;Name&lt;/b&gt; = " .$result["name"] . " &lt;br&gt;";
echo " &lt;b&gt;Age&lt;/b&gt; = " .$result["age"] . " &lt;br&gt;&lt;br&gt;----------------&lt;br&gt;&lt;br&gt;";
}
</code></pre>
