Is there a way to do an “INSERT…ON DUPLICATE KEY UPDATE” in Zend Framework 1.5?

后端 未结 7 1405
独厮守ぢ
独厮守ぢ 2021-01-31 02:25

I would like to use ON DUPLICATE KEY UPDATE in Zend Framework 1.5, is this possible?

Example

INSERT INTO sometable (...)
VALUES (...)
ON DUP         


        
7条回答
  •  春和景丽
    2021-01-31 02:51

    Use this instead:

    REPLACE INTO sometable SET field ='value'.....
    

    This will update if exists or just insert if not. This is a part of the standard mysql api.

提交回复
热议问题