I have a very small script to get all records from a database table, the code is below.
$query = $this->db->get($this->table_name); return $query->
Simple and easy:
$this->db->order_by("name", "asc"); $query = $this->db->get($this->table_name); return $query->result();