does ci support relational db

hi, i m new to ci and i can't figure out how does ci work with relational db. I mean i have 2 tables in db and 1 table has id of another table's content, how do i get another content using that tables id? i have to use loop to echo the content of the 1st table, so can't use another loop, just confused, if u need db structure i can provide.

[eluser]Bart v B[/eluser]
i don't understand youre question.
a relational database has nothing to do with CI or other frameworks.

You want to JOIN two table together, with active Records i gues..

Take a look in the manual Wink

$this->db->join('comments', ' =');

$query = $this->db->get();

// Produces:
// SELECT * FROM blogs
// JOIN comments ON =

I would not recomend this example, but just play with it.

just build your query around it.

$this->db->select('u.first_name, u.last_name, a.street,, a.state,');
$this->db->from('users u');
$this->db->join('addresses a','a.user_id =');
$results = $this->db->get();

thank u all

You could also try an ORM. Search the forums for DMZ, RapidDataMapper or Doctrine.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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