Hi,
I have implemented a simple hit counter to keep track of the # of hits. I need to pull a list of 10 articles with the most hits within the past 30 days. I use the following code and get the following error. Can someone please help? Thanks!
//trending
list($hitsRecords, $hitsMetaData) = getRecords(array(
'tableName' => 'am_articles',
'where' => "date = DATE_SUB(date,30 DAY) AND approved = 1",
'orderBy' => 'hits+0 DESC',
'limit' => 10,
));
MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '30 DAY) AND approved = 1) AND am_articles.hidden = 0 ORDER BY hits+0 DESC LIM' at line 3