900 921 996
911 101 186
     
900 921 996
911 101 186 
1064 - 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 'asc' at line 1

SELECT specials_tarifa FROM specials s WHERE ( customers_id = 0 OR customers_id = 0 OR customers_id = 999999 ) AND ( customers_tipocli = '' OR customers_tipocli = '' ) AND ( products_id = 11585 OR products_id = 0 ) AND ( products_options_values_id = 0 OR products_options_values_id = 0 OR products_options_values_id = 0 OR products_options_values_id is null ) AND ( products_familia = '9' OR products_familia = '' ) AND ( products_tipoart = '' OR products_tipoart = '' ) AND ( specials_cantidad <= 1 OR specials_cantidad = 0 ) AND ( expires_date >= now() OR expires_date is null ) and status = '1' AND specials_tarifa > 0 ORDER BY specials_cantidad desc, IF( products_id > 0 AND customers_id > 0, 1, IF( products_id > 0 AND customers_tipocli != '', 2, IF( products_id > 0 AND customers_id = 0 AND customers_tipocli = '', 3, IF( products_options_values_id > 0 AND customers_id > 0, 4, IF( products_options_values_id > 0 AND customers_tipocli != '', 5, IF( products_options_values_id > 0 AND customers_id = 0 AND customers_tipocli = '', 6, IF( products_tipoart > 0 AND customers_id > 0, 7, IF( products_tipoart > 0 AND customers_tipocli != '', 8, IF( products_tipoart > 0 AND customers_id = 0 AND customers_tipocli = '', 9, IF( products_familia != '' AND customers_id > 0, 10, IF( products_familia != '' AND customers_tipocli != '', 11, IF( products_familia != '' AND customers_id = 0 AND customers_tipocli = '', 12, IF( customers_id > 0 AND products_tipoart = '' AND products_id = 0, 13, IF( customers_tipocli > 0 AND products_tipoart = 0 AND products_id = 0, 14, 15 ) ) ) ) ) ) ) ) ) ) ) asc;

[TEP STOP]