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 'and p.is_stock=1' at line 1
in:
[select count(distinct p.products_id) as total FROM products p, products_description pd, products_to_categories p2c and p.is_stock=1 ]