I\'m new to building databases and I\'m trying to do a JOIN based on a having three database tables.
Table A = ID, Name, etc
Table B = ID, Name, etc
Table C
if you want a flexible query you could use:
http://codeigniter.com/user_guide/database/results.html
which utilizes the following syntax $query = $this->db->query('SELECT * FROM my_table');
here is the query:
SELECT a.name as namea ,b.name as nameb FROM tablec c
JOIN tablea a ON a.ID = c.ID
JOIN tableb b ON b.ID = c.ID
you may want to read more about joins here
then go through your results in such a way:
$query = $this->db->query("YOUR QUERY");
foreach ($query->result_array() as $row)
{
echo $row['namea'];
echo $row['nameb'];
}