getQuery just returns the query.  getQueryParams returns an array of the
parameters passed.  So you need to use both to get both the query and the
data passed to the query.

CM


On Mon, Mar 29, 2010 at 11:23 AM, Mark Steudel <[email protected]> wrote:

> Cool, will this show the combined query if I'm using parameters
>
> e.g.
>
> $id = 5;
>
> $sql = "SEELCT id FROM table WHERE id = ?";
>
> $row = $this->db->fetchOne( $sql, $i );
>
> Will it show:
>
> SELECT id FROM table WHERE id = 5
>
> or
>
> SELECT id FROM table WHERE id = ?
>
> Thnx
>
>
>
> On Mon, Mar 29, 2010 at 1:09 AM, Narinder Chandi <
> [email protected]> wrote:
>
>> Hi. Something like this will work:
>>
>> public function dumpSQL()
>> {
>>    $db           = Zend_Db_Table::getDefaultAdapter();
>>    $dbProfiler   = $db->getProfiler();
>>    $dbQuery      = $dbProfiler->getLastQueryProfile();
>>    $dbSQL        = $dbQuery->getQuery();
>>
>>    print_r($dbSQL);
>> }
>>
>> Regards,
>>
>> Narinder.
>> --
>>
>>  ______________________________________________________
>> | Narinder Chandi, Director,
>> | ToolBox Systems Limited, Surrey, England, UK.
>> | tel : +44 (0)1372 720117, mob : +44 (0)7973 512495
>> | www      : http://www.toolbox.uk.com
>> | Skype    : NarinderChandi
>> | LinkedIn : http://www.linkedin.com/in/toolboxsystems
>> | Twitter  : @ToolBoxSystems
>> |______________________________________________________
>> |         Consultancy * Development * Support
>> |______________________________________________________
>>
>>
>> on 29/03/2010 09:01, Sergio Rinaudo at [email protected] wrote:
>>
>> >
>> > Hi everybody,
>> > if I construct an update query programmatically using Zend_Db, how can I
>> get
>> > this query and how to get what is the problem if the query fails?
>> > Thanks
>> >
>> > Sergio Rinaudo
>> >
>>
>>
>>
>
>
> --
>
> -----------------------------------------
> Mark Steudel
> P: 206.375.7244
> [email protected]
>
> . : Work : .
> http://www.mindfulinteractive.com
>
> . : Play : .
> http://www.steudel.org/blog
>
>
>


  <http://cmorrell.com/> *Chris Morrell*  Web: http://cmorrell.com  Twitter:
@inxilpro <http://twitter.com/inxilpro>

Reply via email to