Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
The line it references is the line where the mysql_fetch_array()
function is called. The query works fine when ran through phpmyadmin
. It also throws no errors. Any help would be appreciated.
$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) >= (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) && (getTimestamp($info['time']) >= ($now - 4500)))
$data15['temp'] = $info['data'];
else
$data15['temp'] = '-';
$dataCnt++;
}