title: PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2973202/mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given-in-select">mysql_fetch_array() expects parameter 1 to be resource, boolean given in select</a>  </p>
  </blockquote>
  
  
  
  <p>The line it references is the line where the <code>mysql_fetch_array()</code> function is called. The query works fine when ran through <code>phpmyadmin</code>. It also throws no errors. Any help would be appreciated.</p>
  
  <pre><code>$query = "select distinct s.time, s.parameter, s.data, t.units from alertData as s, parameters as t where s.parameter like '%Airtemp_Avg%' and s.staID = 'WS_001_UHC' and s.interval_min = 15 and t.parameter like '%Airtemp_Avg%' and unix_timestamp(s.time) &gt;= (unix_timestamp(now()) - 86400) order by time desc";
  $results = mysql_query($query) || die(mysql_error());
  $dataCnt = 0;
  while($info = mysql_fetch_array($results)) {
      //15 Min data
      if(($dataCnt == 0) &amp;&amp; (getTimestamp($info['time']) &gt;= ($now - 4500))) 
         $data15['temp'] = $info['data'];
      else 
         $data15['temp'] = '-';
  
      $dataCnt++;
  }
  </code></pre>