I currently have two tables I want to combine into a single array. This is a little more complicated then it sounds and using left or right join doesn't seem to work.
Let’s say the tables are basically like this:
Items (table):
item_id, sizes
Sizes (table):
size_id, item_id, size_name
One item will have multiple sizes. And this is where I'm running into the problem. In my main display page I want to have a form that shows all the sizes for this particular item, and there are other items listed as well.
So I need to be able to fetch items 1,2,3 and then get the sizes for each of those (preferably in one query).
So it will have:
array(1 => array( size=> array( 0=>size1 1=>size2 2=>size3)) 2=>array(size=>array(0=>size4 1=>size5)))
Hope that makes sense.
Any help would be appreciated.