title: How to write data to array?
body: <p>I am trying to write data from the database to an array. I need to write data to an array in this format:</p>
  <pre><code>$users = [
          'nurgiz'=&gt;'1234',
          'yavdat'=&gt;'qwerty'
      ];
  </code></pre>
  <p>I try to do this:</p>
  <pre><code>$query = $db-&gt;query('SELECT * FROM `test_auth`.`users`');
  $users = [];
  
  while($row = $query-&gt;fetch(PDO::FETCH_ASSOC)){
      $users=  $row['name'] =&gt; $row['pass'];
      echo $users;
  }
  </code></pre>
  <p>How to implement this code correctly?</p>