title: Selecting MySql table data into an array
body: <p>I try to catch data from mysql to put them all in array.
  Suppose:</p>
  
  <pre><code>    users table
      -----------------------
      id| name | code 
      ----------------------
      1| gorge | 2132
      2| flix | ksd02
      3| jasmen | skaod2
  
      $sql = mysql_query("select id, name, code from users");
      $userinfo = array()
      while($row_user = mysql_fetch_array($sql)){
      $userinfo = $row_user[name] 
      }
  -------------------------
  foreach($userinfo as $usinfo){
  echo $usinfo."&lt;br/&gt;";
  }
  </code></pre>
  
  <p>Here is the problem i can only insert user name but cant insert also code &amp; id in userinfo array please help me to insert all data in same array.</p>
  
  <p>[P.S] No object oriented please.</p>