Primeramente recorro un array y de hay estoy intentando realizar una consulta pasandole un dato de array pero al intentar de realizarla me muestra este error.
Justo en esta parte trim('$this->$filas[1]')");
Catchable fatal error: Object of class guardarCompras could not be converted to string in C:\wamp\www\SistemaPlanificacion\modelo\guardarCom pras.Class.php on line 144
Código:
Espero me puedan ayudar.foreach ($detalle as $filas) { $queryId_articulo = $con->prepare("SELECT ID FROM articulos a WHERE a.articulo = trim('$this->$filas[1]')"); $queryId_articulo->execute(); if($id_= $queryId_articulo->fetch()){ $this->setId_articulo($id_[0]);
Saludos.