In PHP
I have an arrangement that will show below, I sent a request to the model and this me retorna el id
, the idea is that I can 'set' 'id_company' => $insert_id
in the array $datos
, but when I did a array_push($datos, ['id_company' => $insert_id])
I created an arrangement in that same arrangement and it's not the idea.
#Este es el arreglo original
$datos = [
'id_rol_user' => 4,
'name' => $this->input->post('name'),
'lastname' => $this->input->post('lastname'),
'email' => $this->input->post('email'),
'username' => $this->input->post('username'),
'password' => sha1($this->input->post('password')),
'photo' => $ruta,
'status' => 1,
];
#Como deberia de quedar
$datos = [
'id_rol_user' => 4,
'name' => $this->input->post('name'),
'lastname' => $this->input->post('lastname'),
'email' => $this->input->post('email'),
'username' => $this->input->post('username'),
'password' => sha1($this->input->post('password')),
'photo' => $ruta,
'status' => 1,
'id_company' => $insert_id,
];