[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