Forum : How can we find the number of rows in a result set using PHP?
Brief description  about Online courses   join in Online courses
View  's Profile

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

Sir,
how to find the number of rows in a result set...
Asked by | Nov 4, 2009 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Naveen,

Here is how can you find the number of rows in a result set using PHP:

$result = mysql_query($any_valid_sql, $database_link);
$num_rows = mysql_num_rows($result);
echo "$num_rows rows found";
Nov 4, 2009