Hello, I am looking for help to show only active products. This is mysql table code: $sql = "SELECT count(*) as total_product FROM insights_base"; PHP: This is the mysql syntax that i try. But in out put in shows all Active and Inactive products. How to make it possible that it shows only Active products. Please help me that it shows only Active products and do not list Inactive products.
You should look into using PDO or mysqli as its so much more secure, mysql is soon to be deprecated. However if you must use mysql try this: $sql = "SELECT count(*) as total_product FROM insights_base where status='ACTIVE'"; Code (markup):