I have a table that contains webcomics and has the following columns: id, title, date, comic, thumbnail, and hits.
I am trying to sort the comics with the most hits in a one month time range by using the following code:
$oneMonth = mysql_query("CREATE VIEW ['oneMonthSort'] AS SELECT * FROM comics WHERE date_time = date_sub(now() interval 1 month)");
$oneMonthSort = mysql_query("SELECT * FROM oneMonthSort ORDER BY 'hits' DESC");
$topOfOne = array();
while($row = mysql_fetch_array($oneMonthSort)){
$thumb = $row["thumbnail"];
echo $thumb;
}
I get the error mysql_fetch_array() expects parameter 1 to be resource, boolean given