I would like to know how to get the number of rows in a resultset for this statement:
$data=$db->query("SELECT name FROM users")->fetchAll();
I need something similar to mysqli_num_rows
but using medoo
.
thanks for your help!
I would like to know how to get the number of rows in a resultset for this statement:
$data=$db->query("SELECT name FROM users")->fetchAll();
I need something similar to mysqli_num_rows
but using medoo
.
thanks for your help!
Since the query()
method returns an array, just use php's count() function to determine the number of records returned (do not set the recursive mode).
In the documentation there is a count method:
$count = $database->count("users");
Try This: Counts the number of rows:
$count = $database->count($table, $where);