From fad38523394d785d8acf13c51da9fda0c31029c4 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 14 Feb 2004 12:39:17 +0000 Subject: [PATCH] Ajour codes d'erreur --- htdocs/cactioncomm.class.php | 59 +++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/htdocs/cactioncomm.class.php b/htdocs/cactioncomm.class.php index 05be7e18d77..3ca200b99d7 100644 --- a/htdocs/cactioncomm.class.php +++ b/htdocs/cactioncomm.class.php @@ -28,12 +28,45 @@ class CActioncomm { { $this->db = $DB; } + /* + * Récupération des données + * + */ + + Function fetch($db, $id) + { + + $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id=$id;"; + + if ($db->query($sql) ) + { + if ($db->num_rows()) + { + $obj = $db->fetch_object(0); + + $this->id = $id; + $this->libelle = $obj->libelle; + + $db->free(); + + return 1; + } + else + { + return 0; + } + } + else + { + print $db->error(); + return -1; + } + } /* * * * */ - Function liste_array() { $ga = array(); @@ -63,29 +96,5 @@ class CActioncomm { print $this->db->error(); } } - - - Function fetch($db, $id) - { - - $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id=$id;"; - - if ($db->query($sql) ) - { - if ($db->num_rows()) - { - $obj = $db->fetch_object(0); - - $this->id = $id; - $this->libelle = $obj->libelle; - - $db->free(); - } - } - else - { - print $db->error(); - } - } } ?>