Having trouble rewriting this SQL query
Currently it only extracts data from the first thread in a specific forum. I want it to call the first 5 threads instead.
Current code:
$latesta = $db->query_first('SELECT title,threadid,views,replycount,postusername,datel ine FROM ' . TABLE_PREFIX . 'thread WHERE 1 AND forumid = 28 ORDER BY dateline DESC LIMIT 0 , 1');
Rewriting it to this:
$latesta = $db->query('SELECT title,threadid,views,replycount,postusername,datel ine FROM ' . TABLE_PREFIX . 'thread WHERE forumid = 28 ORDER BY dateline DESC LIMIT 0 , 5');
Returns a mySQL error so I'm stuck. Any help is appreciated, thanks.
|