Search code examples
phpmysqlmedoo

How to get the number of rows in a resultset using medoo


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!


Solution

  • 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).