Hey everyone. I'm having some trouble returning the correct number of matched results after a search query is issued to my site's search bar.
I was using this, but it returns the wrong number of matches (only for certain queries):
$countofrecs = mysql_query("SELECT count(*) from tablename WHERE title OR description LIKE '%".$searchterm."%' OR catid = '$catid'"); $cnt = mysql_fetch_array($countofrecs); echo "Your search terms returned '$cnt' results";