Skip to content
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 get total count of records with query result? #9

Open
ankitpatelinitio opened this issue Mar 23, 2019 · 1 comment
Open

How to get total count of records with query result? #9

ankitpatelinitio opened this issue Mar 23, 2019 · 1 comment

Comments

@ankitpatelinitio
Copy link

How to get a total count of records with query result because I have to implement pagination with the use of total count of records.

Thanks

@mrbarletta
Copy link
Member

Hi @ankitpatelinitio - currently there is no metadata returned for the query.

I will add this soon as this is available in the function we use to create the listing. SuiteCRM-link


        $response['row_count'] = $rows_found;
        $response['next_offset'] = $next_offset;
        $response['previous_offset'] = $previous_offset;
        $response['current_offset'] = $row_offset;

What we do is to use limit clause to a higher number than the config (usually set to 20) and then check if the query count matches limit if it does, I do another query with offset clause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants