title: PHP How to GROUP BY result array when using LEFT JOIN
body: <p>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 :</p>
  
  <pre><code>SELECT  blockTitre, ChampsType, ChampsNom
  FROM form_builder
      LEFT JOIN block_champs
          ON formBuilderBId = blockId
      RIGHT JOIN ajout_champs
          ON ChampsId = formBuilderChId
  </code></pre>
  
  <p>and When I var_dump the result I get the following :</p>
  
  <pre><code>array (size=6)
    0 =&gt; 
      object(stdClass)[8]
        public 'blockTitre' =&gt; string 'Misc' (length=4)
        public 'ChampsType' =&gt; string 'submit' (length=6)
        public 'ChampsNom' =&gt; string 'submit' (length=6)
    1 =&gt; 
      object(stdClass)[9]
        public 'blockTitre' =&gt; string 'Misc' (length=4)
        public 'ChampsType' =&gt; string 'hidden' (length=6)
        public 'ChampsNom' =&gt; string 'page' (length=4)
    2 =&gt; 
      object(stdClass)[10]
        public 'blockTitre' =&gt; string 'Information général' (length=21)
        public 'ChampsType' =&gt; string 'text' (length=4)
        public 'ChampsNom' =&gt; string 'email' (length=5)
    3 =&gt; 
      object(stdClass)[11]
        public 'blockTitre' =&gt; string 'Information général' (length=21)
        public 'ChampsType' =&gt; string 'text' (length=4)
        public 'ChampsNom' =&gt; string 'prenom' (length=6)
    4 =&gt; 
      object(stdClass)[12]
        public 'blockTitre' =&gt; string 'Information général' (length=21)
        public 'ChampsType' =&gt; string 'text' (length=4)
        public 'ChampsNom' =&gt; string 'age' (length=3)
    5 =&gt; 
      object(stdClass)[13]
        public 'blockTitre' =&gt; string 'Misc' (length=4)
        public 'ChampsType' =&gt; string 'text' (length=4)
        public 'ChampsNom' =&gt; string 'nommm' (length=5)
  </code></pre>
  
  <p>What I want is to regroup result by <strong>blockTitre</strong>.</p>
  
  <p>I tried the SQL statement <code>GROUP BY</code> but it returns only two lines (It's logic I think) !</p>
  
  <p>Please masters how to do to get all lines grouped by <strong>blockTitre</strong>  ?</p>
  
  <p>Thank you in advance.</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>Please I need to get something like :</p>
  
  <pre><code> 0 =&gt;
         'blockTitre' =&gt; string 'Misc' 
              'ChampsType' =&gt; string 'submit' 
              'ChampsNom' =&gt; string 'submit'
              'ChampsType' =&gt; string 'text' 
              'ChampsNom' =&gt; string 'nommm' 
              'ChampsType' =&gt; string 'hidden' 
              'ChampsNom' =&gt; string 'page' 
    1 =&gt;     
         'blockTitre' =&gt; string 'Information général' 
              'ChampsType' =&gt; string 'text' 
              'ChampsNom' =&gt; string 'email' 
              'ChampsType' =&gt; string 'text' 
              'ChampsNom' =&gt; string 'prenom' 
              'ChampsType' =&gt; string 'text' 
              'ChampsNom' =&gt; string 'age'
  </code></pre>