Welcome Guest, Not a member yet? Register   Sign In
erro iin adding offset and limit to active record
#1

[eluser]mardon[/eluser]
Hi in my script I want to add pagination and I edit model to
Code:
function getAll($limit = 0, $offset = 0) {
        //$q = $this->db->query('SELECT certs.ser_cislo, certs.pocatek, certs.konec, certs.id_user, users.prijmeni as jmeno FROM certs,users
        //            WHERE certs.id_user = users.id');
        $this->db->select('certs.*');
        $this->db->select('users.prijmeni as jmeno');
        $this->db->from('certs');
        $this->db->join('users', 'certs.id_user=users.id');
        $q = $this->db->get($limit, $offset);
        if ($q->num_rows() > 0) {
            foreach ($q->result() as $row) {
                $data[] = $row;
            }
            return $data;
        }

but after edit i have the error:

A Database Error Occurred

Error Number: 1146

Table 'certifikat.3' doesn't exist

SELECT `certs`.*, `users`.`prijmeni` as jmeno FROM (`certs`, `3`) JOIN `users` ON `certs`.`id_user`=`users`.`id`

Filename: C:\dev\www\ci_certifikat\system\database\DB_driver.php

Line Number: 330

thx for help with my query


Messages In This Thread
erro iin adding offset and limit to active record - by El Forum - 04-09-2011, 06:07 AM
erro iin adding offset and limit to active record - by El Forum - 04-09-2011, 07:45 AM
erro iin adding offset and limit to active record - by El Forum - 04-09-2011, 09:17 AM
erro iin adding offset and limit to active record - by El Forum - 04-09-2011, 09:30 AM
erro iin adding offset and limit to active record - by El Forum - 04-09-2011, 02:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB