1109 Unknown table 'p' in field list
in:
[select count(p.products_id) as total ]