title: symfony get data from array
body: <p>I'm trying to use an SQL query to get data from my database into the template of a symfony project.</p>
  
  <p>my query:</p>
  
  <pre><code>SQL:
  SELECT l.loc_id AS l__loc_id, l.naam AS l__naam, l.straat AS l__straat, 
  l.huisnummer AS l__huisnummer, l.plaats AS l__plaats, l.postcode AS l__postcode,
  l.telefoon AS l__telefoon, l.opmerking AS l__opmerking, o.org_id AS o__org_id, o.naam AS o__naam 
  FROM locatie l 
  LEFT JOIN organisatie o 
  ON l.org_id = o.org_id
  </code></pre>
  
  <p>This is generated by this DQL:</p>
  
  <pre><code>DQL:
   $this-&gt;q = Doctrine_Query::create()
  -&gt;select('l.naam, o.naam, l.straat, l.huisnummer, l.plaats, l.postcode, l.telefoon, l.opmerking')
  -&gt;from('Locatie l')
  -&gt;leftJoin('l.Organisatie o')
  -&gt;execute();
  </code></pre>
  
  <p>But now when i try to acces this data in the template by either doing:</p>
  
  <pre><code>&lt;?php foreach ($q as $locatie): ?&gt;
  &lt;?php echo $locatie['o.naam'] ?&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;?php foreach ($q as $locatie): ?&gt;
  &lt;?php echo $locatie['o__naam'] ?&gt;
  </code></pre>
  
  <p>i get the error from symfony:</p>
  
  <pre><code>500 | Internal Server Error | Doctrine_Record_UnknownPropertyException
  Unknown record property / related component "o__naam" on "Locatie"
  </code></pre>
  
  <p>Does anyone know what is going wrong here? i dont know how to call the value from the array if the names in both query's dont work.</p>