Per the documentation, mysql_query returns FALSE on an error with the query. Because of this, your argument to mysql_fetch_array is a boolean. Use the mysql_error function to see what's wrong with the SELECT query.
For example,
$result=mysql_query($sql) or die(mysql_error());