How do I do error checking, in my model? For instance if my procedure adds a record I want to return true if not I want to return false. Do I need to do a count on the records in the table before and after the procedure then compare them which is the best way to do this?
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')");
}
Looks like your database is mysql
Use FOUND_ROWS( ) to find rows affected after executing the select statement in the procedure
Or You could use ROW_COUNT() function to find the number of records after insert statement