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

Live API: loadLastVisitorDetailsFromDatabase - $offset + $limit ? #1850

Closed
robocoder opened this issue Dec 1, 2010 · 2 comments
Closed

Live API: loadLastVisitorDetailsFromDatabase - $offset + $limit ? #1850

robocoder opened this issue Dec 1, 2010 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@robocoder
Copy link
Contributor

This looks wrong:

// increase limit by offset when visitor paginates
if(!empty($offset))
{
    $limit += (int)$offset;
}
...
    LIMIT ".(int)$limit;

Since it doesn't look like the $offset is set in the current code, this probably won't be a compat buster: remove the += statement, and change the LIMIT clause to:

    LIMIT ".(int)$offset.",".(int)$limit;
@robocoder
Copy link
Contributor Author

Or use:

    LIMIT ".(int)$limit." OFFSET ".(int)$offset;

which is compatible with PostgreSQL syntax.

@robocoder
Copy link
Contributor Author

(In [3389]) fixes #1850

@robocoder robocoder added this to the Piwik 1.1 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

1 participant