Обновить SQL с тем, где и где условия в codeigniterPhp

Кемеровские программисты php общаются здесь
Anonymous
Обновить SQL с тем, где и где условия в codeigniter

Сообщение Anonymous »

Это мой код: < /p>

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
< /code>

Когда я запускаю этот код, он удалил мои записи. I don't understand why.

I want it to:
UPDATE TABLE WHERE CONDITION_1 AND CONDITION_2 = B

PS:

**$now** is todays date (i.e. 2012-12-25)
**$emp_no** is a unique employee number i.e. 500122


Подробнее здесь: https://stackoverflow.com/questions/140 ... odeigniter

Вернуться в «Php»