Hello,
I wrote a query to find the products names by the name entered and to count now many records are outputted.
$query="SELECT COUNT(product_id) AS tot,product_id,product_name FROM tblproduct WHERE product_name LIKE '%$pname%'";
$query="SELECT COUNT(*) AS tot,product_id,product_name FROM tblproduct WHERE product_name LIKE '%$pname%'";
I tried both way. but always it returns one record, but at the same time output 'tot' as the correct total.
why?