0

So I am pulling 10 records from database at the time using AJAX call.

below is my code:

public function get_next_10($offset = 0)
{
    $this->db->limit(15, $offset);
    $query = $this->db->get("postovi");
    return $query->num_rows() > 0 ? $query->result_array() : NULL;
}

I tried putting:

$this->db->order_by("name", "asc");

but it's throwing an error.

Jeepstone
  • 2,591
  • 5
  • 22
  • 38
FTWwings
  • 105
  • 9

1 Answers1

3

Its Working Fine

public function get_next_10($offset = 0)
{
$this->db->limit(15, $offset);
$this->db->order_by('name', 'asc');
$query = $this->db->get("postovi");
return $query->num_rows() > 0 ? $query->result_array() : NULL;
}
Saravana Dev
  • 304
  • 1
  • 4