title: Storing records in array
body: <p>I have little problem. 
  I want to save records from database in array. 
  But I don't know it doesn't work :/
  I would be grateful for help.</p>
  
  <pre><code>&lt;?php
  require ('common.php');
  
  $query ="SELECT gallery_cat_id, gallery_cat_name FROM gallery_catalogs";
  try{
      $stmt=$db-&gt;prepare($query);
      $stmt-&gt;execute();
      }
              catch (PDOException $ex)
      {
          die('Nie nawiązano połączenia: ' . $ex-&gt;getMessage());              
      }
  
  
      $album=array();
      while($row=$stmt-&gt;mysql_fetch_assoc())
          {
          $album[$row['gallery_cat_id']]=$row['gallery_cat_name'];
          }
  
      echo '&lt;pre&gt;';
      print_r($album);
  
  ?&gt;
  </code></pre>