CodeIgniter Forums

Full Version: $this->db->limit Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

                if ($qcm->num_rows() == 0) {
                } else {
                    if ($this->uri->segment(4)) {
                    } else {
                    $nump = $nump / $perpage;
                    if(intval($nump) != $nump)
                        $data['nump'] = intval($nump) + 1;
                    $lim1 = ($page - 1) * $perpage;
                    $this->db->limit($lim1, $perpage);
I tested the code and without the LIMIT the code works fine
and with it is doesn't select anything!

please help

El Forum

I would look at the SQL and see if it makes sense. If it does, I would try running the SQL in a db app or phpMyAdmin against the record set to see if it returns what I expect. If not, I would tweak the actual query to select the records I expect. Then I would go back to the AR code to produce the correct SQL.

El Forum

[eluser]Thorpe Obazee[/eluser]
run <?php echo $this->db->last_query();?>

this would output the SQL statement. Check the SQL on phpmyadmin or something like it.