From 7c528e0f403c834e718c710bc915fbd870af9f62 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 19 Jun 2003 12:46:38 +0000 Subject: [PATCH] Ajout d'un code retour dans ->fetch --- htdocs/propal.class.php3 | 43 +++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/htdocs/propal.class.php3 b/htdocs/propal.class.php3 index 54fc2e5ee19..f009e14c941 100644 --- a/htdocs/propal.class.php3 +++ b/htdocs/propal.class.php3 @@ -158,26 +158,33 @@ class Propal { * * */ - Function fetch($rowid) { + Function fetch($rowid) + { - $sql = "SELECT ref,price,remise,".$this->db->pdate(datep)."as dp FROM llx_propal WHERE rowid=$rowid;"; + $sql = "SELECT ref,price,remise,".$this->db->pdate(datep)."as dp FROM llx_propal WHERE rowid=$rowid;"; - if ($this->db->query($sql) ) { - if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); - - $this->id = $rowid; - $this->datep = $obj->dp; - $this->ref = $obj->ref; - $this->price = $obj->price; - $this->remise = $obj->remise; - - $this->db->free(); - } - } else { - print $this->db->error(); - } - } + if ($this->db->query($sql) ) + { + if ($this->db->num_rows()) + { + $obj = $this->db->fetch_object(0); + + $this->id = $rowid; + $this->datep = $obj->dp; + $this->ref = $obj->ref; + $this->price = $obj->price; + $this->remise = $obj->remise; + + $this->db->free(); + } + return 1; + } + else + { + print $this->db->error(); + return 0; + } + } /* * *