select subject as subject,image,id,views from scu.NEWS as tb where tb.enable=1 and tb.startDate < NOW() and (tb.endDate > NOW() or tb.endDate is null or tb.endDate ='0000-00-00 00:00:00') and tb.categoryId= order by views desc limit 4
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order by views desc limit 4' at line 1