Welcome Guest, Not a member yet? Register   Sign In
Codeigniter multi table model
#1

So im kinda lost at this moment. i use codeigniter 2.x and i stucked at last view i need to do .

One thing that sets this view apart from others is that it needs data from 6 deferent tables. How do i do this ?
Reply
#2

If the view will contain a combination of the 6 tables you will need to join the tables in your model using SQL join.
If your view contains separate data from the six tables, you would call the respective queries in your model 6 times,

PHP Code:
$data['query1result'] = $this->model->getQuery1();
$data['query2result'] = $this->model->getQuery2(); 

etc.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB