Welcome Guest, Not a member yet? Register   Sign In
how to retrieve data from multiple table
#1
Exclamation 

Hallo everybody...
i want to make a website like main category and sub category then content.

see the attachment.
Thanks in advance

Attached Files Thumbnail(s)
   
Reply
#2

You can use "join" in the CI query builder. Like this:

PHP Code:
$this->db
->select('t1.maincat_name,t2.subcat_name')
->
from('categories t1')
->
join('subcategories t2','t2.cat_id = t1.id')
->
where('t1.maincat_name','Jokes');
$query $this->db->get(); 

For more information:
http://www.codeigniter.com/userguide3/da...lder::join
Reply




Theme © iAndrew 2016 - Forum software by © MyBB