Welcome Guest, Not a member yet? Register   Sign In
A query in multiple tables
#3

[eluser]ray73864[/eluser]
or if you want to keep with the approach you were on, use:

Code:
$this->db->select('w.name, c.rating');
$this->db->from('wines w');
$this->db->where('user_id', getUserProperty('id'));
$this->db->join('wine_comments wc','w.id = wc.wine_id');

$data['query']= $this->db->get();

either of the 2 ways will work fine, just depends on which way you want to go.


Messages In This Thread
A query in multiple tables - by El Forum - 10-01-2008, 02:33 PM
A query in multiple tables - by El Forum - 10-01-2008, 04:33 PM
A query in multiple tables - by El Forum - 10-01-2008, 05:17 PM
A query in multiple tables - by El Forum - 10-01-2008, 05:38 PM
A query in multiple tables - by El Forum - 10-01-2008, 05:52 PM
A query in multiple tables - by El Forum - 10-01-2008, 08:42 PM
A query in multiple tables - by El Forum - 10-01-2008, 08:58 PM
A query in multiple tables - by El Forum - 10-01-2008, 09:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB