Welcome Guest, Not a member yet? Register   Sign In
query only returns one row
#3

(09-25-2015, 01:11 PM)pdthinh Wrote:
(09-25-2015, 12:38 PM)webmachine Wrote: I am very new to CodeIgniter and struggling with piecing together my first CI site.

I am trying to use the Query Builder to get all the records from a database table called 'case_statuses'.

In my Model I have




Code:
public function get_case_status() {

$query = $this->db->get('case_statuses');
       return $query->row_array();

}

Change your model to return $query->result_array() to retrieve all rows of table.
More references http://www.codeigniter.com/user_guide/da...sults.html

Thank you! Worked like a charm. Now I need to go back to the documentation and find out why I made that mistake.
Reply


Messages In This Thread
query only returns one row - by webmachine - 09-25-2015, 12:38 PM
RE: query only returns one row - by pdthinh - 09-25-2015, 01:11 PM
RE: query only returns one row - by webmachine - 09-25-2015, 01:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB