title: How to insert values in assosiative array with mysqli_fetch_array()
body: <p>I want to make array with key 'barang' that contains ids of barang in my database.
  Here my code</p>
  
  <pre><code>while ($globalBarang = mysqli_fetch_array($sqlBarang)) {
       $arrayglobal["barang"] = array($globalBarang['id_brg']);
  }
  </code></pre>
  
  <p>for now with print_r() it result</p>
  
  <pre><code>Array ( [barang] =&gt; Array ( [0] =&gt; SSB-001 ) )
  </code></pre>
  
  <p>What I want:</p>
  
  <pre><code>Array ( [barang] =&gt; Array ( [0] =&gt; BRS-001, 
                              [1] =&gt; GLP-001, 
                              [2] =&gt; SSB-001 ) )
  </code></pre>
  
  <p>Here my database if needed:
  Database:<br>
  <a href="https://i.stack.imgur.com/PgMxD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PgMxD.png" alt="Database"></a></p>