• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.