-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to count records? #25
Comments
Hello @gfh31fgh2 There is no specific function in the library to do this, but it is possible to obtain it through the $db = $service->initializeDatabase('products', 'id');
try{
$listProducts = $db->fetchAll()->getResult(); //fetch all products
echo "Total: " . count($listProducts) . " rows on product table";
}
catch(Exception $e){
echo $e->getMessage();
} |
Thanks for answer! But for count > 100k, it isnt good function for this.
|
Hi, I struggle same issue, but after read the discussion here, I found out that the count parameter and response was calculated in header of request & response. What I do is :
I don't recommend to use GET request to do this because it will render the body section, but use HEAD instead more lighter |
How to count records with this api?
The text was updated successfully, but these errors were encountered: