Q: A Database Error Occurred Error Number: 1048 2.0 I would like a query about the following problem, what happens is that I am sending my variables with the post method with php, but it tells me that it is sending a null value and that the database rejects it, but when I see the inspector I get that if data is sent.
This is how the data looks like inside the DB
This is my code:
public function addEvidencia(){
    $data["eCodUsuario"] = $this->session->userdata("eCodUsuario");
    $data["eCodReporte"] = $this->input->post("eCodReporte");
    $data["tEvidencia"] = $this->input->post("tEvidencia");
    $data["dRegistro"] = date("Y-m-d H:i:s");
    
    

    $insReporteEvidencia = $this->Inserts->insReporteEvidencia($data); 
    $conReporteEvidencia = $this->Consultas->getReporteEvidencia($data["eCodReporte"], $data["dRegistro"]);

    $bandera = true;
    if($this->input->post("eCodEstado") == 4){
        if($insReporteEvidencia){
            $data4["eCodEstado"] = $this->input->post("eCodEstado");

            $updReporte = $this->Inserts->updReporte($data["eCodReporte"],$data4);
            if(!$updReporte){
                $bandera == false;
            }
        }

    }else{  
        if($conReporteEvidencia && $insReporteEvidencia){
            $files = $_FILES;
            $numeroImagenes = count($_FILES["tImagen"]["name"]);
            
            foreach ($conReporteEvidencia as $cre) {

                for ($i=0; $i < $numeroImagenes; $i++) {
                    $nombreImagen = "CAPDAM".date("Y-m-d-H-i-s").".jpg";
                    $this->load->library('upload');

                    $_FILES["tImagen"]["name"]      = $files["tImagen"]["name"][$i];
                    $_FILES["tImagen"]["type"]      = $files["tImagen"]["type"][$i];
                    $_FILES["tImagen"]["tmp_name"]  = $files["tImagen"]["tmp_name"][$i];
                    $_FILES["tImagen"]["error"]     = $files["tImagen"]["error"][$i];
                    $_FILES["tImagen"]["size"]      = $files["tImagen"]["size"][$i];

                    $config['file_name'] = $nombreImagen;
                    $config['upload_path'] = "./assets/img/evidencias/";
                    $config['allowed_types'] = 'jpg|jpeg';
                    
                    $this->upload->initialize($config);
                    
                    if ($this->upload->do_upload("tImagen")){
                        $fileData = $this->upload->data();
                        $data2["tImagen"] = "assets/img/evidencias/".$fileData["file_name"];
                        $data2["eCodReporteEvidencia"] = $cre["eCodReporteEvidencia"];

                        $insReporteImagenes = $this->Inserts->insReporteImagenes($data2);

                        if(!$insReporteImagenes){
                            $bandera == false;
                        }
                    }else{
                        echo json_encode(array('status' => 0,
                                    'msg' => "No se pude guardar las imagenes, intenta mas tarde"));
                    }

                    $_FILES["tImagen"]["name"]      = null;
                    $_FILES["tImagen"]["type"]      = null;
                    $_FILES["tImagen"]["tmp_name"]  = null;
                    $_FILES["tImagen"]["error"]     = null;
                    $_FILES["tImagen"]["size"]      = null;
                }
            }

            $data3["eCodEstado"] = $this->input->post("eCodEstado");

            $updReporte = $this->Inserts->updReporte($data["eCodReporte"],$data3);
            if(!$updReporte){
                $bandera == false;
            }
        }else{
            echo json_encode(array('status' => 0,
                                    'msg' => "No se pude guardar la informacion, intenta mas tarde"));
        }
    }

    if($bandera){
        echo json_encode(array('status' => 1));
    }else{
        echo json_encode(array('status' => 0,
                                'msg' => "No se pude guardar la informacion, intenta mas tarde"));
    }

}


