diff --git a/vendor/model/Products.class.php b/vendor/model/Products.class.php index 34a2997..f0a0a31 100644 --- a/vendor/model/Products.class.php +++ b/vendor/model/Products.class.php @@ -85,13 +85,13 @@ class Products /** Consulta SQL */ $this->sql = 'select * from products - where products_id = :products_id'; + where product_id = :product_id'; /** Preparo o SQL para execução */ $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam(':products_id', $this->productsId); + $this->stmt->bindParam(':product_id', $this->productsId); /** Executo o SQL */ $this->stmt->execute(); @@ -151,7 +151,7 @@ class Products public function Count() { /** Consulta SQL */ - $this->sql = 'select count(products_id) as qtde + $this->sql = 'select count(product_id) as qtde from products'; /** Preparo o SQL para execução */ @@ -188,13 +188,13 @@ class Products reference = :reference, version = :version, version_release = :version_release - where products_id = :products_id'; + where product_id = :product_id'; /** Preparo o sql para receber os valores */ $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam('products_id', $this->productsId); + $this->stmt->bindParam('product_id', $this->productsId); $this->stmt->bindParam('products_type_id', $this->productsTypeId); $this->stmt->bindParam('description', $this->description); $this->stmt->bindParam('reference', $this->reference); @@ -243,13 +243,13 @@ class Products /** Consulta SQL */ $this->sql = 'delete from products - where products_id = :products_id'; + where product_id = :product_id'; /** Preparo o sql para receber os valores */ $this->stmt = $this->connection->connect()->prepare($this->sql); /** Preencho os parâmetros do SQL */ - $this->stmt->bindParam('products_id', $this->productsId); + $this->stmt->bindParam('product_id', $this->productsId); /** Executo o SQL */ return $this->stmt->execute();