HOW CAN WE FIND THE NUMBER OF ROWS IN A RESULT SET USING PHP?

Awadhendra Tiwari

Total Post:510

Points:2550
Posted by  Awadhendra Tiwari
PHP 
PHP
 1299  View(s)
Ratings:
Rate this:
  1. Awadhendra Tiwari

    Post:510

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

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

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!