I'd like to display the total of number of records a query found and then the search results below it. Currently I do this with 2 queries like so:
$total_results = $mydb->count($qry);
$r = $mydb->find($qry)
->skip($pagination*$results_per_page)
->limit($results_per_page);
Is it possible to somehow combine the count and find queries into a single call that returns both info? Or can this only be done by issuing 2 separate queries like I'm already doing?