Ajuste classe Products.class.php

This commit is contained in:
Kenio 2025-07-17 14:03:25 -03:00
parent bffaae912d
commit 134595afa9

View file

@ -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();