title: How to get data in a one dimensional array for a single column?
body: <p>I am using MYSQLI query to extract data into an array. But when printing the array content, it looks that data is being populated into sub array. This is my code:</p>
  <pre><code>
  &lt;?php
  require_once 'database.php';
  
  // Choose the y-axis
  $sql = &quot;SELECT `O3` FROM giordan_mod ORDER BY id DESC LIMIT 4&quot;;
  $resulty = mysqli_query($conn, $sql);
  $datay = [];
  while($row = mysqli_fetch_array($resulty, MYSQLI_NUM))
  {
        $datay[] = $row;
  }
  
  echo '&lt;pre&gt;'; print_r($datay);'&lt;/pre&gt;';
  ?&gt;
  
  &lt;?php
  $test = array(4, 6, 9, 15);
  echo '&lt;pre&gt;'; print_r($test);'&lt;/pre&gt;';
  ?&gt;
  </code></pre>
  <p>But when printing the array, the result are as follows:</p>
  <pre><code>    Array
  (
      [0] =&gt; Array
          (
              [0] =&gt; 40.25
          )
  
      [1] =&gt; Array
          (
              [0] =&gt; 39.64
          )
  
      [2] =&gt; Array
          (
              [0] =&gt; 40.13
          )
  
      [3] =&gt; Array
          (
              [0] =&gt; 40.28
          )
  
  )
  
  Array
  (
      [0] =&gt; 4
      [1] =&gt; 6
      [2] =&gt; 9
      [3] =&gt; 15
  )
  </code></pre>
  <p>But I would like that MYSQLI query input data into an array and not sub array. That is I need $datay array looks as $test array.</p>