A Database Error Occurred

Error Number: 1064

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 'OR `products`.`sort_num` = AND `products`.`cre_date` > ORDER BY `products`.`sort' at line 5

SELECT `products`.* FROM (`products`) WHERE `products`.`id` != '207' AND `products`.`sort_num` < OR `products`.`sort_num` = AND `products`.`cre_date` > ORDER BY `products`.`sort_num` DESC, `products`.`cre_date` ASC

Filename: /var/www/vhosts/pps.com.tw/httpdocs/controllers/products.php

Line Number: 163