0

50e59f3e9c4e5d94efdbea6bc00b2e2c I have three tables, and I'm going to show the third table. What I want to know is how to delete each entry from it? As, the first and the second tables ids are fetched and inserted in the third one. As in, I have my model as follows.

public function delhr($Interior_house_id, $Interior_room_id)
    {
    //echo '<pre>'; print_r($Interior_house_id);
    $abc= implode(',', array('Interior_house_id'));
    print_r($abc);
    print_r($Interior_room_id); exit;
    $this->db->where(Interior_house_id,$Interior_house_id);
    $this->db->where(Interior_room_id,$Interior_room_id);
    $data = $this->db->delete('house_room');    
    return $data;
    }

The following is in my controller file.

public function delhr($Interior_house_id,$Interior_room_id)
    {
        //print_r($interior_house_room_id);
        $delete = $this->admin_model->delhr($Interior_house_id, $Interior_room_id);
        //echo '<pre>'; print_r($delete);
        if($delete) redirect('gethr');
    }

Please help me as to how to delete them. As in I have to use both ids to delete. a single record.

Edited by kantigniter

2
Contributors
2
Replies
15
Views
4 Years
Discussion Span
Last Post by kantigniter
0

First argument of where() method is a string, at the moment it seems to be a constant, so change them to:

$this->db->where('Interior_house_id', $Interior_house_id);
$this->db->where('Interior_room_id', $Interior_room_id);
0

Done, but it still is showing some issues. I have taken a third id. I'll mark this as solved and put it in another one. It's a bit of a mess. Thanks for taking time to help me out.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.