Getting Query Record Count in PHP

If this post helps you, click an ad

To get the record count returned by a query in PHP, use the mysql_num_rows function, as follows:

$user = $_POST["Username"];
$pass = $_POST["Password"];
$query = mysql_query(”call MyProcedure(’$user’,’$pass’)”) or die( mysql_error() );

echo mysql_num_rows($query);

Tags: , ,

One Response to “Getting Query Record Count in PHP”

  1. Guru Says:

    I was trying to use this code but I was getting following error:
    ==== Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource ====

Leave a Reply