Fix: Bad parameter

This commit is contained in:
Laurent Destailleur 2011-05-18 16:44:11 +00:00
parent 39bcf8bd63
commit 9ff7905f0c

View File

@ -294,13 +294,12 @@ class MouvementStock
$sql.= " FROM ".MAIN_DB_PREFIX."product_composition"; $sql.= " FROM ".MAIN_DB_PREFIX."product_composition";
$sql.= " WHERE fk_product = $fk_product;"; $sql.= " WHERE fk_product = $fk_product;";
$all = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql)
if ($all)
{ {
while($item = $this->db->fetch_object($all) ) while ($item = $this->db->fetch_object($resql))
{ {
if($item->etat_stock != 0) array_push($products_compo,$item); if ($item->etat_stock != 0) array_push($products_compo,$item);
} }
$this->db->free($resql); $this->db->free($resql);
} }
@ -358,7 +357,6 @@ class MouvementStock
$obj=$this->db->fetch_object($resql); $obj=$this->db->fetch_object($resql);
$nbSP=$obj->nb; $nbSP=$obj->nb;
} }
$this->db->free($resql);
return $nbSP; return $nbSP;
} }