Before do this read CURD part 01 and two...
Ok here is the codes need to delete data.
Add these codes to previous lesson controller and save it.
public function delete(){
$id=$this->request->data('Student.ID');
$this->loadModel('Student');
$this->Student->des($id);
//$this->Student->delete($id);
}
Now add below codes to model and save it.
public function des($id){
$this->delete($id);
}
now create a model called delete.ctp and add below codes and save it in relavant dirsctory as we did in previous lessons.
now go to the web browser and type http://localhost/learncake/Students/delete and you will see the data has deleted in the table
Bye...
Ok here is the codes need to delete data.
Add these codes to previous lesson controller and save it.
public function delete(){
$id=$this->request->data('Student.ID');
$this->loadModel('Student');
$this->Student->des($id);
//$this->Student->delete($id);
}
Now add below codes to model and save it.
public function des($id){
$this->delete($id);
}
now create a model called delete.ctp and add below codes and save it in relavant dirsctory as we did in previous lessons.
now go to the web browser and type http://localhost/learncake/Students/delete and you will see the data has deleted in the table
Bye...