Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in

 

解决方案:
$sql = "SELECT * FROM news where ruse='$nowname' and DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date order by rid";
  $query = mysql_query($sql);
  if($query){
     $row = mysql_fetch_array($query);
}
先判断后取值,解决

posted @ 2018-05-10 15:06  阿波罗任先生  阅读(2111)  评论(0编辑  收藏  举报