I am trying to build a simple delete function in my project to delete data from a table. I .can't figure out why it is not working. I used the codeigniter user guide to help me out with this. I am getting an error and don't know why. Here is my controller, model and view for the delete:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: stdClass::$id
Model
function delete()
{
$this->load->database();
$tables = array('info', 'info2');
$this->db->where('id', 1);
$this->db->delete($tables);
}
controller
function del($tables){
if((int)$tables > 0){
$this->info_model->delete($tables);
}
$data = $this->info_model->delete();
$data['query'] = $this->result_model->delete();
$this->load->view('info_view',$data);
}
view
//this line gives me the error
<td><?php echo anchor('info_controller/del' . $row->id,'Delete')?> </td>
EDIT
I used this tutorial to make this
http://www.phpeveryday.com/articles/CodeIgniter-Form-Centralizing-$data-P291.html