Welcome Guest, Not a member yet? Register   Sign In
3 level join using AR
#1

[eluser]stevenL[/eluser]
Hey all,

I am trying to wrap my brain around how to set up a CI model for the following structure.

My basic object is called a "project". A project can contain multiple images and can exist in multiple categories.

So I have 3 tables:

---------
categories
---------
projects
---------
images
---------

Each has a foreign key relating to the table above it.

When a category link is clicked, I need to display a list of projects, ordered by a sort_order column in the projects table. Each project in the resulting list would contain the row from the projects table as well as all the associated images from the images table.

Not sure where to start in the model. Should this be a multi-level join? Or single queries concatenated into a multi-dimensional array? Any help appreciated.


Messages In This Thread
3 level join using AR - by El Forum - 03-14-2009, 01:21 PM
3 level join using AR - by El Forum - 03-14-2009, 01:54 PM
3 level join using AR - by El Forum - 03-14-2009, 03:29 PM
3 level join using AR - by El Forum - 03-14-2009, 04:04 PM
3 level join using AR - by El Forum - 03-14-2009, 04:14 PM
3 level join using AR - by El Forum - 03-14-2009, 04:50 PM
3 level join using AR - by El Forum - 03-14-2009, 06:27 PM
3 level join using AR - by El Forum - 03-15-2009, 01:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB