Update query in CodeIgniter doesn't change any rows because there is no submission data
17:28 25 Jun 2018

I'm trying to update a table column using CodeIgniter.

Controller:

public function search2()
{
    if ($_POST) {
        $Interno = $_POST['Interno'];
    } else {
        $Interno = '';
    }
    $this->db->select('empleados.Interno, empleados.Curp, empleados.Nombre, empleados.A_Paterno, empleados.A_Materno, cuentas.Clabe, cuentas.Banco, cuentas.Observaciones, cuentas.Status');
    $this->db->from('empleados');
    $this->db->join('cuentas',"cuentas.Interno = empleados.Interno AND cuentas.Status !='I'", 'Left');
    $this->db->where('empleados.Interno', $Interno);
    $q = $this->db->get();
    $data = array();
    $data['records'] = $q->result_array();
    $this->load-> view('main/indice', $data);  
}

public function update_Status() 
{
    $Interno = $this->input->post('Interno');
    $data = array(
        'Status' => $this->input->post('Inactivo')
    );
    if ($this->consultas_M->update_Status($Interno, $data)) {
        echo " update successful...";
    } else {
        echo "update not successful...";
    }  
}

With function search2, I display results from two tables (that might be the problem) then I want to change the status of table cuentas to 'I' (inactive it is 'A' active by default). So I just want to update that Status column. But it doesn´t do anything. Also, when I print the submission data from the controller, the values are empty.

This is my model

public function update_Status($Interno,$data)
{
    $this->db->where('Interno', $Interno);
    $this->db->update('cuentas', $data);
}

'Interno' is the id from the table and also the input name where that id is displayed.

php mysql codeigniter sql-update submission