title: Create associative array from 2 columns in PHP and MySQL
body: <p>Can I make an associative array from two columns? I want column A as key and column B as value. </p>
  
  <pre><code>-------------
  | id | name  |
  -------------
  | 1  | sky   |
  -------------
  | 2  | space |
  </code></pre>
  
  <p>I want a function that make result like this:</p>
  
  <pre><code>$ary=array('1'=&gt;'sky','2'=&gt;'space', ... );
  </code></pre>
  
  <p>Is any php function exist about this matter?</p>
  
  <p>I'm using php, mysql and codeigniter.</p>