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

Call to undefined method DB::_limit() #2

Open
victorhramos opened this issue Sep 12, 2016 · 1 comment
Open

Call to undefined method DB::_limit() #2

victorhramos opened this issue Sep 12, 2016 · 1 comment

Comments

@victorhramos
Copy link

Trying to use limit method
$this->db->limit(1);

Fatal error: Uncaught Error: Call to undefined method DB::_limit() in C:\laragon\www\codemarket\system\library\db.php:1773 Stack trace: #0

C:\laragon\www\codemarket\system\library\db.php(889): DB->_compile_select() #1

@victorhramos
Copy link
Author

Wrote simply method only to avoid that error, need some more tests and implementation:

public function _limit($sql, $limit, $offset = 1)
    {
        if (!is_numeric($offset)) {
            $offset = 1;
        }

        $sql .= " LIMIT {$limit}, {$offset}";

        return $sql;
    }

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

No branches or pull requests

1 participant