Notice Array to string in line 72

2

I have the problem with an insert in php the rest of the models make it perfect except this one, I leave the insert code pointing to the line 72

public function Insertar($r){
        try {
            $sql="INSERT INTO reporte(reporte_id,reporte_ubicacion,reporte_compra,reporte_equipo,reporte_centro,reporte_observacion) VALUES(?,?,?,?,?,?)";
    //linea 72  $this->pdo->prepare($sql)->execute(array(
                $r->reporte_id,
                $r->reporte_ubicacion,
                $r->reporte_compra,
                $r->reporte_equipo,
                $r->reporte_centro,
                $r->reporte_observacion
            ));
            $id=$this->pdo->lastInsertId();
            return $id;
        } catch (Exception $e) {
            die($e->getMessage());
        }
    }
    
asked by David Guzman 09.11.2018 в 15:17
source

1 answer

0
public function CargarExcel(){
    require "PHPExcel/CargarExcel.php";
    foreach ($filas as $fila) {
        foreach ($fila as $valor) {
            if($valor['A']!="Nombre" && $valor['A']!=null){
            $this->model->setReporte_id($valor['A']);
            $this->model2->setUbi_ciu($valor['B']);
            $this->model2->setUbi_dep($valor['C']);
            $this->model2->setUbi_tipo_punto($valor['D']);
            $this->model2->setUbi_piso($valor['E']);
            $this->model2->setUbi_ubicacion_fisica($valor['F']);
            $id2=$this->model2->Insertar($this->model2);
            $this->model3->setCentro_nombre($valor['G']);
            $this->model3->setCentro_codigo($valor['H']);
            $this->model3->setCentro_categoria($valor['I']);
            $this->model3->setCentro_servicio(['J']);
            $id3=$this->model3->Insertar($this->model3);
            $this->model4->setEquipo_nom($valor['K']);
            $this->model4->setEquipo_mar($valor['L']);
            $this->model4->setEquipo_mod($valor['M']);
            $this->model4->setEquipo_serie($valor['N']);
            $this->model4->setEquipo_est($valor['O']);
            $this->model4->setEquipo_placa($valor['P']);
            $this->model4->setEquipo_docu($valor['Q']);
            $id4=$this->model4->Insertar($this->model4);
            $this->model5->setCompra_año($valor['R']);
            $this->model5->setCompra_costo($valor['S']);
            $this->model5->setCompra_adquisicion($valor['T']);
            $this->model5->setCompra_fecha_factura($valor['U']);
            $this->model5->setCompra_factura($valor['V']);
            $this->model5->setCompra_garantia($valor['W']);
            $this->model5->setCompra_ven_garantia($valor['X']);
            $this->model5->setCompra_soporte($valor['Y']);
            $this->model5->setCompra_descripcion($valor['Z']);
            $id5=$this->model5->Insertar($this->model5);
            //Este es el insertar que bota el Notice
            $this->model->setReporte_ubicacion($id2);
            $this->model->setReporte_centro($id3);
            $this->model->setReporte_equipo($id4);
            $this->model->setReporte_compra($id5);
            $this->model->setReporte_observacion($valor['AA']);
            $this->model->Insertar($this->model);
            }
        }
    }
    header("location:?c=reporte&a=Lista");

}
    
answered by 09.11.2018 в 16:25