刪除動作我想更新,並在此刪除條目,我真的新,我不知道放在哪裏function..so是的,我需要幫助編輯與笨
控制器
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');
}
和我的觀點
<?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在這個真正的新所以請考慮這個..
是否有問題,或者你只是想與我們分享嗎? – Shomz
這可能會幫助你。 [Codeigniter的CRUD功能](http://code.tutsplus.com/articles/codeigniter-from-scratch-day-5-crud-net-6504)這是一個古老但很好的教程,讓你在路上。並不是所有的東西都是最新的,但是如何實例化一個對象並使用你的函數不會改變。 – Newbi3
放哪裏*什麼*功能?這裏有什麼問題? –