I am doing an ajax call..which doesnt output any mysql errors..Basically, I am trying to delete two records...
public function task_delete($task_id)
{
$this->load->database();
$this->db->delete('task_pages', array('id' => $task_id));
$this->db->delete('tasks', array('id' => $task_id));
}
This is the model..
And this is the controller..
class Ajax extends CI_Controller {
public function delete()
{
$this->load->database();
$this->load->model('tasks_model','task_delete');
$result=$this->task_delete-> task_delete($this->input->post('myId'));
echo $result;
}
}
Where does my code fails?
UPDATE: I get an error..the method deleteTask is being called on none object
task_delete, but you're callingdeleteTask.