lucan Posted September 21, 2011 Share Posted September 21, 2011 Need some help on my result counter. I am using a search box to return data from my database i can get the result returned fine but i am having problems getting the total number of result returned. It only returns the number of results per page as i am using a paginate. Can some one point me in the right direction. The number count im using is below. $num_rows = mysql_num_rows($sql); echo "$num_rows Results Found\n"; Link to comment https://forums.phpfreaks.com/topic/247606-result-counter/ Share on other sites More sharing options...
requinix Posted September 21, 2011 Share Posted September 21, 2011 Change your query to say SELECT SQL_CALC_FOUND_ROWS ... LIMIT X, Y Run it as normal. Then run a second query afterwards SELECT FOUND_ROWS() to get the count. FOUND_ROWS() Link to comment https://forums.phpfreaks.com/topic/247606-result-counter/#findComment-1271498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.