CodeIgniter Forums
Joining 3 tables together - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Joining 3 tables together (/showthread.php?tid=40911)



Joining 3 tables together - El Forum - 04-22-2011

[eluser]xerosis[/eluser]
I have three tables:
1. keywords
2. pricelist
3. pricelist_keyword

Basically the pricelist_keyword is where we assign:
- id
- pricelist_id
- keyword_id
- text_price
- image_price

How can I write a query without making it like this: `tablename`.`field` but get the following:

- pricelist_id
- title (from keyword)
- keyword_id
- text_price
- image_price

I know I can write a long query but the issue is that in my config (DB config) file I have given my database fields a dbprefix of adp_ so if need to write this code in a way that I have to assign the table adp_keyword or adp_pricelist it kind of ruins the purpose.

What must I do?

Thanks.


Joining 3 tables together - El Forum - 04-22-2011

[eluser]xerosis[/eluser]
what?