I am trying to SELECT COUNT Total records of a table, what am I doing wrong ? thanks in advance
I am getting this error
Fatal error: Call to a member function fetch_row() on boolean
<?php
$mysqli = new mysqli('localhost','root','','testing');
//Output any connection error
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
//get total number of records
$results = $mysqli->query("SELECT COUNT(*) FROM users");
$get_total_rows = $results->fetch_row(); //hold total records in variable
$mysqli->close();
?>