Warning: mysql_query(): MySQL server has gone away in /home/unisale/public_html/system/database/mysql.php on line 21Warning: mysql_query(): Error reading result set's header in /home/unisale/public_html/system/database/mysql.php on line 21Error: MySQL server has gone away
Error No: 2006
SELECT COUNT(DISTINCT p.product_id) AS total FROM uns_product p LEFT JOIN uns_product_discount pdis ON p.product_id = pdis.product_id AND pdis.customer_group_id = '1' and pdis.quantity <= '1' AND ((pdis.date_start = '0000-00-00' OR pdis.date_start < NOW()) AND (pdis.date_end = '0000-00-00' OR pdis.date_end > NOW())) LEFT JOIN uns_product_special ps ON p.product_id = ps.product_id AND ps.customer_group_id = '1' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) LEFT JOIN uns_product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN uns_product_to_category p2c ON (p.product_id = p2c.product_id) WHERE p.status = '1' AND p2s.store_id = '0' AND p.date_available <= NOW() AND IF(pdis.quantity, pdis.quantity, '1') = '1' AND p2c.category_id = '477'