Zend Framework: How to delete a table row where multiple things are true?

后端 未结 3 440
不思量自难忘°
不思量自难忘° 2020-12-05 10:35

Normally, this would work for me:

$db = Zend_Db_Table::getDefaultAdapter();
$where = $db->quoteInto(\'id = ?\', $id);
$db->delete(\'tablename\', $where         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 11:17

    To extend on Jason W's answer:

    Not exactly sure what the 3rd section is saying

    That means you can do this:

    $db->delete('tablename', array(
        'first_id = ?' => $first_id,
        'second_id = ?' => $second_id
    ));
    

    And the adapter will quote everything for you.

    I don't feel like the documentation is very clear though.

提交回复
热议问题