select data from row error
<p>I have some code which selects data from a row. It is working and prints the result correctly, but I have an error I can not figure out.</p>

<pre><code>$rs=array();    
$select=array ("system_name", "location", "alarmtype", "severity", "start_time",     "end_time", "duration", "reason","shift_oparation", "system_oparation");

for ($i=0;$i&lt;=9;$i++){
    $SQL = "SELECT (".$select[$i].") FROM (".$is.")  WHERE duration=('".$ic."') AND location=('".$id."')";
    $result = mysql_query($SQL);
    $db_field = mysql_fetch_array($result);
    $rs[$i]=$db_field[$select[$i]];
    echo $rs[$i];
}
</code></pre>

<p>Echo prints correctly, but there is an error:</p>

<p><code>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given.</code></p>
