views:

17

answers:

0

I really hope i'm overlooking here, but I really can't figure it out anymore. I'm at the point where copying a working piece of code to somewhere else makes it stop functioning... :(

I have the following code which sets up a RawSql query for Doctrine, and outputs the sql query. I get some errors which I'm unable to resolve which I posted below the code. Please help me from my misery! Your help is greatly appreciated...

Code

    $q = new Doctrine_RawSql();
    $q
    ->select('{f.*}')
    ->from('Facility f')
    ->addComponent('f', 'Facility f');
    echo $q->getSqlQuery();

Output (CodeIgniter error message, i left out some formatting)

please note that the SqlQuery IS printed, however without columns to be selected

<h4>A PHP Error was encountered</h4> 

<p>Severity: Notice</p> 
<p>Message:  Undefined index:  f</p> 
<p>Filename: Doctrine/RawSql.php</p> 
<p>Line Number: 258</p> 

<h4>A PHP Error was encountered</h4> 

<p>Severity: Warning</p> 
<p>Message:  implode() [<a href='function.implode'>function.implode</a>]: Invalid     arguments passed</p> 
<p>Filename: Doctrine/RawSql.php</p> 
<p>Line Number: 258</p> 
SELECT  FROM Facility f