From aa10b5522911616833550020a47ceb9685ee1960 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 5 May 2007 14:04:40 +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/propal.class.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 7d047d714b4..88cd81765e4 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -1710,11 +1710,13 @@ class Propal extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql.= " WHERE c.rowid = $id"; - if ($this->db->query($sql)) - { - if ($this->db->num_rows()) - { - $obj = $this->db->fetch_object(); + $result = $this->db->query($sql); + + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; @@ -1727,22 +1729,22 @@ class Propal extends CommonObject $this->user_creation = $cuser; if ($obj->fk_user_valid) - { - $vuser = new User($this->db, $obj->fk_user_valid); - $vuser->fetch(); - $this->user_validation = $vuser; - } + { + $vuser = new User($this->db, $obj->fk_user_valid); + $vuser->fetch(); + $this->user_validation = $vuser; + } if ($obj->fk_user_cloture) - { - $cluser = new User($this->db, $obj->fk_user_cloture); - $cluser->fetch(); - $this->user_cloture = $cluser; - } + { + $cluser = new User($this->db, $obj->fk_user_cloture); + $cluser->fetch(); + $this->user_cloture = $cluser; + } } - $this->db->free(); + $this->db->free($result); } else