Total Geting Counts in MySQL
$rowCount = $conn->query('SELECT COUNT(*) FROM Users');
echo '<pre>'.print_r($rowCount,1).'</pre>';
returns:
mysqli_result Object
(
[current_field] => 0
[field_count] => 1
[lengths] =>
[num_rows] => 1
[type] => 0
)
... although there are 978 rows in the table as I see in PHPMyAdmin.
+3
source to share
2 answers