这是我的代码:
public function remove_employee( $emp_no, $now ) {
$this->db->delete('employees', array('emp_no' => $emp_no));
$this->db->flush_cache();
$this->db->start_cache();
$this->db->where('emp_no', $emp_no);
$this->db->where('to_date', '9999-01-01');
$this->db->update('dept_emp', array('to_date' => $now));
$this->db->stop_cache();
$this->db->flush_cache();
$this->db->start_cache();
$this->db->where('emp_no', $emp_no);
$this->db->where('to_date', '9999-01-01');
$this->db->update('salaries', array('to_date' => $now));
$this->db->stop_cache();
$this->db->flush_cache();
$this->db->start_cache();
$this->db->where('emp_no', $emp_no);
$this->db->where('to_date', '9999-01-01');
$this->db->update('titles', array('to_date' => $now));
$this->db->stop_cache();
$this->db->flush_cache();
return;
} //END REMOVE EMPLOYEE
当我运行此代码时,它删除了我的记录。我不明白为什么。
我希望它: 更新表,其中CONDITION_1和CONDITION_2 = B
PS:
**$now** is todays date (i.e. 2012-12-25)
**$emp_no** is a unique employee number i.e. 500122