2008年10月23日星期四

Re: [fw-db] How can I display the query when using Zend_Db_Table update()

Thanks Giuliano,

I did use the Try-Catch approach and just printed the complete catched
object. In there I found the query and saw what was wrong.
So I think my problem is solved!

Here's what I did:

try{
parent::update($data, $where);
} catch(Zend_Exception $e){

print "<pre>";
print_r($e);
print "</pre>";
}

Giuliano Riccio wrote:
>
> Maybe you can wrap the update in a try-catch and use the Zend_Db_Profiler
> to get the executed
> query, although I don't know if it will appear after giving the error.
> Give it a try ;)
>
> Giuliano
>
> etopian wrote:
>>
>> Hi,
>>
>> Maybe I'm approaching this wrongly, but I'm using Zend_Db_Table update()
>> to update a record in a db. However, I get am SQL error when executing.
>> So I would like to display the actual SQL before it is executed, so I can
>> see what is not in the query when executed.
>>
>> Is there a function to do this?
>>
>
>

--
View this message in context: http://www.nabble.com/How-can-I-display-the-query-when-using-Zend_Db_Table-update%28%29-tp20126169p20127202.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: