From 5d1f4e32c7579a0a8a1581a2f6cf068ca9de357f Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 4 Apr 2005 12:16:49 +0000 Subject: [PATCH] Mise aux normes SQL --- htdocs/fournisseur.commande.class.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/fournisseur.commande.class.php b/htdocs/fournisseur.commande.class.php index c6720e218c6..14800f94f19 100644 --- a/htdocs/fournisseur.commande.class.php +++ b/htdocs/fournisseur.commande.class.php @@ -71,11 +71,11 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_methode_commande_fournisseur as cm ON cm $sql .= " WHERE c.rowid = ".$id; - $result = $this->db->query($sql) ; + $resql = $this->db->query($sql) ; - if ( $result ) + if ( $resql ) { - $obj = $this->db->fetch_object(); + $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; $this->ref = $obj->ref; @@ -95,20 +95,25 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_methode_commande_fournisseur as cm ON cm $this->facturee = $obj->facture; $this->projet_id = $obj->fk_projet; - $this->db->free(); + $this->db->free($resql); if ($this->statut == 0) { $this->brouillon = 1; } - return 0; + + $result = 0; + } else { dolibarr_syslog("CommandeFournisseur::Fetch Error $sql"); dolibarr_syslog("CommandeFournisseur::Fetch Error ".$this->db->error()); - return -1; + $result = -1; } + + return $result ; + } /** * Log