CodeIgniter Add & Update Database without success, no error, nothing, just wont work

Try something like this(controller update_student)

$query = $this->Stud_Model->update($data, $old_roll_no);
if ($query->result() {
$data['records'] = $query->result();
}
$this->load->view('Stud_view', $data);

You do not need the $query = $this->db->get('stud');, because your model should be returning that. But your model isnt returning anything You have to initiate the method with an if statement. Try that in your other functions and make sure you are not updating in both controller and model. Also, when referring to controllers and models in your classes, use lower case names. Here is an example of an insert without using a model. Be sure and validate and escape your data

function enterPosts()
{
$this->is_logged_in();
$data = [
  'title'   => html_escape(trim($this->input->post('title'))),
  'content' => trim($this->input->post('content')),
  'date'    => html_escape(trim($this->input->post('date'))),
  'parent'  => html_escape(trim($this->input->post('parent'))),
  'status'  => html_escape(trim($this->input->post('status'))),
  'slug'    => trim($this->input->post('slug'))
];

$this->form_validation->set_rules('title', 'Title', required|max_length[50]',));
$this->form_validation->set_rules('content', 'content',  'required|min_length[50]'));
$this->form_validation->set_rules('date', 'Date', 'required');
$this->form_validation->set_rules('parent', 'Parent', 'required');
$this->form_validation->set_rules('status', 'Status', 'required');
$this->form_validation->set_rules('slug', 'Slug', required|trim|min_length[30]'));
if( $this->form_validation->run() == FALSE) {
        echo validation_errors(); //or just load your form view
    }else
    {
        $this->db->insert('posts', $data);

    }
 } //end of enterposts