$query = "SELECT a.postid,a.threadid,a.pagetext,a.title,a.visible". "\n FROM #__bb_post AS a". "\n WHERE a.visible = 1". "\n ORDER BY a.postid desc". "\n LIMIT $count";