How can we find the number of rows in a result set using PHP?

Posted by Prem Tiwari | Updated on

Are you searching for How can we find the number of rows in a result set using PHP? In this answer, we have shared a PHP script to get the number of rows in a result set using PHP.

PHP mysql_num_rows() function will retrieves the number of rows from a result set. This command is only valid for statements like SELECT or SHOW that return an actual result set.

Following are the example mysql_num_rows() function, which used to number of rows from MySQL table.

Example #1 mysql_num_rows() example


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers