I handle this at the level of the model using an exists($keys : Array)
method on a generic DataObject. A dataobject is like an active record.
That way you can check myDataObject->exists() to find out what you have
to do.
Regards,
Bart McLeod
Kevin Hallmark schreef:
For future reference for anyone who has my problem:
http://www.nabble.com/REPLACE-queries-on-Zend_Db-td15617859.html
Basically, as far as I can tell, Zend_Db doesn’t support ‘INSERT
IGNORE’ or ‘ON DUPLICATE KEY UPDATE’ syntax using Zend_Db_Table and
Zend_Db_Table_Row.
You’re only choice is to use the query method of the Zend_Db_Adapter
class of your choice and manually creating the query.
Kevin Hallmark
------------------------------------------------------------------------
*From:* Kevin Hallmark [mailto:[EMAIL PROTECTED]
*Sent:* Tuesday, May 13, 2008 9:53 AM
*To:* [email protected]
*Subject:* [fw-general] INSERT IF NOT EXISTS with Zend_Db_Table_Row
Is it possible to INSERT IF NOT EXITSTS using a Zend_Db_Table_Row or
should I generate the query by hand?
I searched the docs but I couldn’t find anything.
Kevin Hallmark