增加了错误判断

This commit is contained in:
Li Jianxuan 2011-11-01 02:01:22 +00:00
parent d42c9978e9
commit 29fed60dd2
1 changed files with 8 additions and 9 deletions

View File

@ -442,20 +442,19 @@ class ReviewController extends Zend_Controller_Action
$sql = "insert into mdreview ($keys) values ($values) RETURNING id";
$sth = $this->db->prepare($sql);
$sth->execute();
echo '<div class="box box-success">保存成功!</div>';
exit();
if($sth->execute())
{
echo '<div class="box box-success">保存成功!</div>';
exit();
}else{
echo '<div class="box box-error">保存草稿出错,请稍后再试!</div>';
exit();
}
}catch (Exception $e){
echo '<div class="box box-error">保存失败,请重试!</div>';
exit();
}
}// saveAction 存草稿 ajax
function searchAction()