title: Get column content as array key
body: <p>I am rewrting a newsletter-thingy.</p>
  
  <p>I have a table for all newsletter fields, that is like this:</p>
  
  <pre><code>field_uid | field_name | field_content | field_letter_id 
  </code></pre>
  
  <p>Where f.x. the column <code>field_name</code> can have the value <code>letter_headline</code>
  and the column <code>field_content</code> can have the value <code>My headline</code>.</p>
  
  <p>When I do this:</p>
  
  <pre><code>$fields = $this-&gt;db-&gt;dbh-&gt;query("SELECT field_name, field_content FROM newsletter_fields WHERE field_letter_uid = '". $letter_id ."'"); 
  
  foreach($fields-&gt;fetchAll(PDO::FETCH_ASSOC) as $key) {
     print_r($key);
  }
  </code></pre>
  
  <p>It will correctly give me this:</p>
  
  <pre><code>Array ( [field_name] =&gt; letter_image0 [field_content] =&gt; image.jpg ) 
  Array ( [field_name] =&gt; letter_headline [field_content] =&gt; My headline ) 
  Array ( [field_name] =&gt; letter_headline_size [field_content] =&gt; 12 ) 
  Array ( [field_name] =&gt; letter_sub_headline [field_content] =&gt; My subheadline ) 
  Array ( [field_name] =&gt; letter_sub_headline_size [field_content] =&gt; 10 ) 
  Array ( [field_name] =&gt; letter_content [field_content] =&gt; Letter content ) 
  Array ( [field_name] =&gt; letter_link [field_content] =&gt; www.example.com )
  Array ( [field_name] =&gt; letter_link_txt [field_content] =&gt; Example )
  </code></pre>
  
  <p>What I want is to build an array like this</p>
  
  <pre><code>$field["letter_image"] = "image.jpg";
  $field["letter_headline"] = "My headline"
  </code></pre>
  
  <p>And then I can output the content with:</p>
  
  <pre><code>echo $field["letter_image"];
  </code></pre>
  
  <p>But I can't seem to figure out how to set the field array.</p>