如何在我的模型中进行错误检查?例如,如果我的程序添加了一条记录,我想返回 true,否则我想返回 false。我是否需要在程序前后对表中的记录进行计数然后比较它们,这是执行此操作的最佳方法吗?
function add_student($SECTION_ID, $STUDENT_ID)
{
$this->db->query("call add_student('$SECTION_ID','$STUDENT_ID')");
}
function drop_student($SECTION_ID, $STUDENT_ID)
{
$this->db->query("call drop_student('$SECTION_ID','$STUDENT_ID')");
}
最佳答案
关于mysql - 模型中的错误检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12209712/