내 모델에서이 기능을 실행하려고하면 문제가 발생합니다. print 문이 인쇄됩니다. Child_Name
= '테스트' 및 Parent_username
= 'tester2'내가 명령 줄에서 실행Codeigniter가 삭제 쿼리를 실행하지 않습니다
은 (기록이 존재하고 삭제) 제대로 작동 WHERE
는child_participants
에서 삭제. 그러나 내 웹 응용 프로그램에서 시도 할 때 오류가 있지만 실제로 아무것도 삭제하지 않습니다. 컨트롤러와 모델에서 데이터를 수신하기 때문에 데이터를 올바르게 전달하고 있음을 알고 있습니다. 뭐라 구요? documentation에서function remove_child($username, $participant_name) { $where = "`Child_Name`='$participant_name' and`Parent_username`='$username'"; $this->db->where($where, null, false); $this->db->delete($this->child_table); echo $this->db->last_query(); }
$ this-> db -> _ error_message();'- 오류를 확인하십시오. –
주제에서 벗어나지 만, codeigniter의 쿼리 작성 코드를 활용하여 SQL 삽입 공격을 막아야합니다. – Matthew
@AmalMurali 주어진 오류 출력이 없습니다. – Undermine2k