title: How can I return two arrays in php that are overwritting?
body: <p>I'm trying to bring these two arrays with the second foreach loop, however it only stores the second array, where the id=13</p>
  <pre><code>array(1) {
    [0]=&gt;
    array(3) {
      [&quot;employee_id&quot;]=&gt;
      string(4) &quot;10&quot;
      [&quot;chores_id&quot;]=&gt;
      string(1) &quot;1&quot;
      [&quot;id&quot;]=&gt;
      string(1) &quot;12&quot;
    }
  }
  array(1) {
    [0]=&gt;
    array(3) {
      [&quot;employee_id&quot;]=&gt;
      string(4) &quot;10&quot;
      [&quot;chores_id&quot;]=&gt;
      string(1) &quot;1&quot;
      [&quot;id&quot;]=&gt;
      string(1) &quot;13&quot;
    }
  }
  </code></pre>
  <pre><code>foreach(($_SESSION['ROLES']) as $v){
      $sql=&quot;SELECT employee_id,chores_id,id FROM table id={$v}&quot;;
      echo($sql);
      $result = $conn-&gt;executeSQL($sql);   
      $array = array();   
      foreach($result as $v){
          $array[]=$v;
      }  
  }
       
  return $array;   
  </code></pre>
  <p>When I do an echo to my variable $sql it seems to bring the values that I want</p>
  <pre><code>SELECT employee_id,chores_id,id FROM table where id=12
  SELECT employee_id,chores_id,id FROM table where id=13
  </code></pre>
  <p>but when I want to print them in the second foreach just prints one</p>