• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List to Array[][]

#1
[eluser]xiii29[/eluser]
Hi !
I'm using CodeIgniter with Doctrine as ORM. In parts of my apps, I need to request 3 tables (A, B & C) where C contains keys of A & B. Looks as C as an N-N associated tables containing infos on the association.

The presentation should be something like that :
B1 | B2 | B3
---------------
A1| C1 | C2 | C3
...

In order to avoid to many request, I would like to retreive all data in one request :
A1 B1 C1
A1 B2 C2
A1 B3 C3
A2 B1 C11
...

And then translate the result in a array :
$arr[<A>][<B>] = <C>

I'm wondering if there some helper or others methods to improve the mechanism ...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.