From 5150842005b35c7fd2ad5404bd876349475917c9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 5 May 2007 14:18:12 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20$result=20non=20d=E9fini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/paiement.class.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/paiement.class.php b/htdocs/paiement.class.php index 90d0941f625..cd5dbd4ef26 100644 --- a/htdocs/paiement.class.php +++ b/htdocs/paiement.class.php @@ -80,11 +80,13 @@ class Paiement $sql.= ' WHERE p.fk_paiement = c.id'; $sql.= ' AND p.rowid = '.$id; - if ($this->db->query($sql)) + $result = $this->db->query($sql); + + if ($result) { - if ($this->db->num_rows()) + if ($this->db->num_rows($result)) { - $obj = $this->db->fetch_object(); + $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; $this->ref = $obj->rowid; $this->date = $obj->dp; @@ -102,7 +104,7 @@ class Paiement { return -2; } - $this->db->free(); + $this->db->free($result); } else { @@ -335,11 +337,13 @@ class Paiement $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement as c'; $sql .= ' WHERE c.rowid = '.$id; - if ($this->db->query($sql)) + $result = $this->db->query($sql); + + if ($result) { - if ($this->db->num_rows()) + if ($this->db->num_rows($result)) { - $obj = $this->db->fetch_object(); + $obj = $this->db->fetch_object($result); $this->id = $obj->idp; if ($obj->fk_user_creat) { @@ -356,7 +360,7 @@ class Paiement $this->date_creation = $obj->datec; $this->date_modification = $obj->tms; } - $this->db->free(); + $this->db->free($result); } else {