SELECT count(p.virtuemart_product_id) AS total FROM `#__virtuemart_products` p LEFT JOIN `#__virtuemart_product_manufacturers` as pm ON p.`virtuemart_product_id` = pm.`virtuemart_product_id` LEFT JOIN `#__virtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id` WHERE pc.`virtuemart_category_id` IN (228) AND p.`published` = "1" Table 'giantsfishing-com.#__virtuemart_products' doesn't exist