CodeIgniter Forums
joint query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: joint query (/showthread.php?tid=8468)



joint query - El Forum - 05-19-2008

[eluser]Unknown[/eluser]
hi everyone,

I have been looking for a tutorial that describes how to deal with multiple tables.

with larger sites there are multiple tables cross referenced. for example in a store we have to make a query for
product
image
product - image xref
category
product - category xref
and so on...

so my question is, since I can only send one set of data from the Model to the View I seem to have to make one big query that pulls everything.

in php I used to make loops in loops. like query for product and then inside that loop I would query for images related for that product.

can anyone show me an example how I am supposed to deal with this in the MVC structure.
the examples out there don't go farther than explaining the MVC structure with one table in the data base.

thanks,
luke


joint query - El Forum - 05-19-2008

[eluser]zimco[/eluser]
If i correctly understood what you were asking about: performing multiple queries on different tables in one database. I think this thread Please Help Multiple Queries might help you.


joint query - El Forum - 05-19-2008

[eluser]mironcho[/eluser]
Hi ladamis,
You are looking for explanation how to create query with multiple joins and how to use returned result, right?