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 'ORDER BY a.val=0 DESC, -a.val, a.val DESC
                LIMIT 1)' at line 9
SQL: 
                SELECT a.idproduct, a.val, a.idgroup, b.idmenu
                FROM goods_value a, goods_property b
                WHERE a.idproperty=b.idproperty AND b.order_by IN (1,3,4,5,8,9,10,6)  AND a.idgroup IN (1002)
                AND a.idproduct=(SELECT a.idproduct
                FROM goods_value a, goods_property b
                WHERE a.idproperty=b.idproperty  AND a.idgroup IN (1002) AND
                      b.order_by IN(6)
                      AND a.val<
                ORDER BY a.val=0 DESC, -a.val, a.val DESC
                LIMIT 1)
*** EXCEPTION: 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 'ORDER BY a.val=0 DESC, -a.val, a.val DESC
                LIMIT 1)' at line 9
BACKTRACE:

Fatal error: Uncaught exception 'PUBLISHER3\CORE\MyException' in /www/core/MySQL.class.php:47 Stack trace: #0 /www/core/modules/goods/client.class.php(448): PUBLISHER3\CORE\MySQL->my_query('? ...') #1 /www/core/modules/goods/client.class.php(92): PUBLISHER3\CORE\MODULES\GOODS\client->showProduct() #2 /www/core/modules/Modules.class.php(83): PUBLISHER3\CORE\MODULES\GOODS\client->action(NULL, NULL) #3 /www/core/Publisher3.class.php(54): PUBLISHER3\CORE\MODULES\Modules->moduleAction(NULL, NULL, true) #4 /www/engine.php(44): PUBLISHER3\CORE\Publisher3->moduleAction() #5 /www/cindex.php(3): include('/www/engine.php') #6 {main} thrown in /www/core/MySQL.class.php on line 47