Please to simplify the explanation of my problem, let's say that I've done a small sql query to select data from three tables :
SELECT blockTitre, ChampsType, ChampsNom
FROM form_builder
LEFT JOIN block_champs
ON formBuilderBId = blockId
RIGHT JOIN ajout_champs
ON ChampsId = formBuilderChId
and When I var_dump the result I get the following :
array (size=6)
0 =>
object(stdClass)[8]
public 'blockTitre' => string 'Misc' (length=4)
public 'ChampsType' => string 'submit' (length=6)
public 'ChampsNom' => string 'submit' (length=6)
1 =>
object(stdClass)[9]
public 'blockTitre' => string 'Misc' (length=4)
public 'ChampsType' => string 'hidden' (length=6)
public 'ChampsNom' => string 'page' (length=4)
2 =>
object(stdClass)[10]
public 'blockTitre' => string 'Information général' (length=21)
public 'ChampsType' => string 'text' (length=4)
public 'ChampsNom' => string 'email' (length=5)
3 =>
object(stdClass)[11]
public 'blockTitre' => string 'Information général' (length=21)
public 'ChampsType' => string 'text' (length=4)
public 'ChampsNom' => string 'prenom' (length=6)
4 =>
object(stdClass)[12]
public 'blockTitre' => string 'Information général' (length=21)
public 'ChampsType' => string 'text' (length=4)
public 'ChampsNom' => string 'age' (length=3)
5 =>
object(stdClass)[13]
public 'blockTitre' => string 'Misc' (length=4)
public 'ChampsType' => string 'text' (length=4)
public 'ChampsNom' => string 'nommm' (length=5)
What I want is to regroup result by blockTitre.
I tried the SQL statement GROUP BY but it returns only two lines (It's logic I think) !
Please masters how to do to get all lines grouped by blockTitre ?
Thank you in advance.
EDIT :
Please I need to get something like :
0 =>
'blockTitre' => string 'Misc'
'ChampsType' => string 'submit'
'ChampsNom' => string 'submit'
'ChampsType' => string 'text'
'ChampsNom' => string 'nommm'
'ChampsType' => string 'hidden'
'ChampsNom' => string 'page'
1 =>
'blockTitre' => string 'Information général'
'ChampsType' => string 'text'
'ChampsNom' => string 'email'
'ChampsType' => string 'text'
'ChampsNom' => string 'prenom'
'ChampsType' => string 'text'
'ChampsNom' => string 'age'