Page 1 of 1

Zend_DB bind variables problem

Posted: Thu May 31, 2007 9:21 am
by dude81
Hi,
I've the following situation where in I'm sending data through bind variables to the MySQL using PDO objects of Zend Framework All I'm doing is I'm building a sub-query by user clicks on the backend and sending it to the main query as a bind parameter variable. A typical variable would be of the following kind

Code: Select all

[geneated_sql]=>"SELECT * FROM bla where as='asa''"
The query returns a null object as a result which is not right answer.

What am I doing wrong?

Is there a someway, where I can print the whole query that is being run on the backend in Zend framework I'm using Zend Framework 0.4 version

Any help is greatly appreciated.


Thanks
Dude

Posted: Thu May 31, 2007 9:52 am
by CoderGoblin
As a point of interest, the Zend Framework Release version is currently at release candidate 1. There are a lot of differences between 0.4 and the current version so if you can I would recommend looking into the new version and trying to update.

In response to your question...

You can get some information about queries you send with the Zend Db Profiler although I don't think it replaces your passed array within the SQL.

Two possible query types are

Code: Select all

$result = $db->fetchAll('SELECT * FROM bla WHERE as = ?', 'asa');
$result = $db->fetchAll('SELECT * FROM bla WHERE as = :value', array('value'=>'asa'));
Finally your question would be served as a new topic as this is not really related to the shop.

Posted: Thu May 31, 2007 4:46 pm
by John Cartwright
Split from viewtopic.php?t=66007&start=120

This didn't belong in the Example Shop thread, please don't try to hijack