i want to update and delete an entry im really new at this and i dont know where to put the function..so yeah i need help
controller
function delete()
{
$this->site_model->delete_row('booking');
$this->view();
}
}
site_model
function delete_row()
{
$this->db->where('id', $this->uri->segment(3));
$this->db->delete('booking');
}
and my view
<?php
$this->table->set_heading("Name","Nationality","Number of Guest","Date","Package","Other Request","Delete Record");
$qry = $this->db->get('booking');
foreach ($qry->result() as $row) {
$this->table->add_row($row->name,$row->nationality,$row->number_of_guest,$row->date,$row->package,$row->request);
}
echo $this->table->generate();
?>
TIA, im really new at this so please consider this..