bonjour à toutes et à tous,
mon prob est que je n'arrive pas à réaliser une requête qui retourne un tableau imbriqué selon des jointures :

données :

1er table :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
array(2) { [0]=> array(4) { ["IdOrg"]=> string(1) "1" ... } }
2eme table :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
 array(3) { [0]=> array(4) { ["IdSO"]=> string(1) "1" ["Idorg"]=> string(1) "1" ... } }
3eme table :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
array(4) { [0]=> array(12) { ["IdDocs"]=> string(1) "1" ["IdOrg"]=> string(1) "1" ["IdSO"]=> string(1) "1" ... } }
je veux sélectionner les champs de tout les tables et le résultat soit comme suite :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
array(2) { [0]=> array(4) { ["IdOrg"]=> string(1) "1" ["taleau 2"]=> array(){ 
 
	[0]=> array(4) { ["IdSO"]=> string(1) "1" ["Idorg"]=> string(1) "1" ["taleau 3"]=> array(){
 
		[0]=> {["IdDocs"]=> string(1) "1" ["IdOrg"]=> string(1) "1" ["IdSO"]=> string(1) "1"}
		[1]=> {["IdDocs"]=> string(1) "1" ["IdOrg"]=> string(1) "1" ["IdSO"]=> string(1) "1"}
...
}
	[1]=> array(4) { ["IdSO"]=> string(1) "1" ["Idorg"]=> string(1) "1" ["taleau 3"]=> array(){
 
		[0]=> {["IdDocs"]=> string(1) "1" ["IdOrg"]=> string(1) "1" ["IdSO"]=> string(1) "1"}
		[1]=> {["IdDocs"]=> string(1) "1" ["IdOrg"]=> string(1) "1" ["IdSO"]=> string(1) "1"}
...
}
 
} ... } }
mon code est le suivant:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
$select = $db->select();
           $select->from(array("p" => "tableau1"), array("p.IdOrg"))
		     ->join(array("u" => "tablea2"),'p.IdOrg = u.Idorg' , array("u.IdSO"))
		    ->join(array("d" => "tableau3"),'d.IdSO = u.IdSO')
		    ->group(array('d.IdOrg'))
							   ;
 
	    $res = $db->fetchAll($select);
or ce code donne un autre résultat (résultat aplatis ):



Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
array(2) { [0]=> array(14) { ["IdOrg"]=> string(1) "1" ["IdSO"]=> string(1) "1" ["IdDocs"]=> string(1) "2" } [1]=> array(14) { ["IdOrg"]=> string(1) "1" ["IdSO"]=> string(1) "1" ["IdDocs"]=> string(1) "3" } 
...
}
merci d'avance