Zend Db

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Zend_DB bind variables problem

Post 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
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
Post Reply