无法插入数据库 - PHP

I have an ajax which triggers a function called which runs an update and insert query. When i check from my db, i realise only the update query is running but then, the insert query never runs. The code below also shows my insert query to be correct.

What could be the issue with my code why the update query works and insert query doesn't work?

users.php

$('#click').click(function () {
        var age = 12
        $.ajax({
            url: '<?php echo base_url('users/demand'); ?>',
            data: '&age='+age,
            type: 'POST'
        }).done(function (result) {
           var obj = $.parseJSON(result);
            $.each(obj, function (index, element) {

              $.ajax({
              url: '<?php echo base_url('users/supply'); ?>',
             data: '&number='+element.phone+'&email='+element.email+'&age='+element.age,
              type: 'POST'
              }).done(function (result) {
                     //refresh page for changes    
              });
          });

        });

    });



function supply()
    {
       $value =  $_POST['age'];

       $query="update table SET `status` = 0 WHERE age IN ($value)";
       $this->db->query($query);

       $save_query="INSERT INTO table(`status`)VALUES ($value)";
       $this->db->query($save_query);

    }

Try to add this between your query

$this->db->reset_query();

- using this your query object is reset

Like:

function supply()
    {
       $value =  $_POST['age'];

       $query="update table SET `status` = 0 WHERE age IN ($value)";
       $this->db->query($query);
       $this->db->reset_query();
       $save_query="INSERT INTO table(`status`)VALUES ($value)";
       $this->db->query($save_query);

    }

OR

function supply() {
    $value = $this->input->post('age');
    $this->db->where_in("age", $value);
    $this->db->update("table", array("status" => 0));

    $this->db->reset_query();
    $this->db->insert("table", array("status" => $value));
}