我可以轻松地从中检索数据,但是当我尝试从删除时删除了我的表中的所有数据,这有什么问题?
$db = $this->serviceLocator->get('Zend\Db\Adapter\Adapter');
$sel = new Sql($db);
$s=$sel->delete('milestone','goal_id='.$edit_id);
echo $s->getSqlString();
答案 0 :(得分:1)
我认为问题来自id。
试试这个: -
<?php
$db = $this->serviceLocator->get('Zend\Db\Adapter\Adapter');
$sql = new Sql( $db );
$delete = $sql->delete('milestone')->where("goal_id = $edit_id");
//see the deleted entry
$deleteString = $sql->getSqlStringForSqlObject($delete);
echo $deleteString;
?>