I *just* realized what you are referring to.

It is _very important_ to note if you're talking about Zend_Db, or 
Zend_Db_Table....
In this case...

You're thinking of the depreciated, multiple argument nature of building a select using Zend_Db_Table's fetchAll method. <http://framework.zend.com/manual/en/zend.db.table.html#zend.db.table.fetch-all>
That is, $table->fetchAll($where, $order, $limit, $offset), which is definitely 
deprecated.

In this particular case, you cannot use Zend_Db_Table::fetchAll() the same way Zend_Db::fetchAll() can be used (which is what I was referring to earlier). You're stuck using an instance of Zend_Db_Select until the depreciated method arguments are totally dropped.

However, in the mean time, you could do the following:

$adapter = $table->getAdapter();
$results = $adapter->fetchAll('SELECT whatever FROM sometable st WHERE r1 = ? 
AND r2 = ?', array(1,2);

This, however, will not return an instance of your defined rowset class....






Jason Webster wrote:
As far as I know, that is definitely not the case.

Daniel Latter wrote:
Yes you can but I think fetchAll is deprecated in favour of select object


On Jan 1, 2009, at 0:34, Jason Webster <[email protected]> wrote:

You can do exactly that already. Your sample code will work as expected.

Mark Steudel wrote:
I was wondering if there is a quick way to do raw sql with multiple place holders.
e.g.
$sql = �gSELECT id FROM table WHERE id = ? AND field2 = ?�h;
$rows = $db->fetchAll( $sql, array( $id, $value ) );
I know I could do this using zend�fs select, but sometimes this is just faster �c
Thanks



Reply via email to