$sql = "SELECT COUNT( '1' ) AS `num`
FROM `tbl_product`
WHERE `cat_id` =$cat_id
AND `product_status` =1";
Here:
$cat_id = 1
product_status = 1= active
In the Above Code i can get the num as 7 as there are 7 products based on cat_id
$sqi = "SELECT COUNT( '1' ) AS `num` *
FROM tbl_cat
JOIN tbl_product ON tbl_cat.cat_id = tbl_product.cat_id
AND product_name LIKE '%$similar%'
AND cat_name LIKE '%$field%'"
Here:
cat_id=1
$similar = input value
$field = cat_id(Value)
But in the above query i cannot get the num as 7 as i'm using search button So can any one help me on this.
Thank You!