Açıklama

The behaviour of mysqli_num_rows() depends on whether
buffered or unbuffered result sets are being used.
For unbuffered result sets, mysqli_num_rows()
will not return the correct number of rows until all the rows in the result
have been retrieved.

in php 5.3.8 had unexpected troubles when checking for mysqli_result::$num_rowsIf the result of the query is empty then var_dump of the result will be like this:class mysqli_result#5 (5) { public $current_field => NULL public $field_count => NULL public $lengths => NULL public $num_rows => NULL public $type => NULL}but var_dump($result->num_rows) will give integer-typed zero instead of NULL:int(0)

$conn = new mysqli("localhost", "root", "", "my_db");// run a query on a table from your DB.

$sql_rec = $conn->query("select count(msisdn) from my_colum where id = '$id'"); // Take out the Where Clause if not Needed. if($sql_rec == true) { echo " The Total Number of MSISDNs are " . $sql_rec->num_rows; } else { echo "Something Bad has happened, We have informed the village Elders.". $conn->connect_error(); }$conn->close();