fetch_view.php This is my fetch_view.php file through this file I am showing my html.
<?php
foreach ($h->result() as $row)
{ ?>
<tr>
<td><?php echo $row->fname; ?></td>
<td><?php echo $row->lname; ?></td>
<td><?php echo $row->email; ?></td>
<td><?php echo $row->mobile; ?></td>
<td><?php echo $row->message; ?></td>
<td><a href="<?= site_url('home/form').'/'.$row->id ?>">Edit</a></td>
<td><a href="<?= site_url('home/delete').'/'.$row->id ?>">Delete</a></td>
</tr>
<?php } ?>
select.php This is my model in this task.
public function deleteuser($id)
{
$this->load->database();
$this->db->where('id', $id);
$this->db->delete('student');
return true;
}
**home.php**
Controller function, In this file I am making a delete function. , I have attached screenshot when I tried to delete data I am facing that error.
public function delete()
{
$this->load->model('select');
$id=$this->input->get('id');
if($this->select->deleteuser($id))
{
$data['data']=$this->select->getuser();
$this->load->view('fetch_view', $data);
}
}