From 7903ef6d1b367ecd46da49b571aa3d8acd8b0f6b Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 20 Jul 2004 15:36:52 +0000 Subject: [PATCH] Modif retours et erreurs dans fetch() --- htdocs/societe.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 2d672f0e130..281de698431 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -155,9 +155,8 @@ class Societe { $sql .= " AND s.fk_effectif = e.id"; $sql .= " AND s.fk_pays = p.rowid"; $sql .= " AND s.fk_forme_juridique = fj.code"; - $result = $this->db->query($sql); - if ($result) + if ($this->db->query($sql)) { if ($this->db->num_rows()) { @@ -222,14 +221,21 @@ class Societe { $this->note = $obj->note; - return 1; - + return 1; } + else + { + print "Aucun enregistrement trouvé
$sql"; + return -2; + } + $this->db->free(); } else { + /* Erreur select SQL */ print $this->db->error(); + return -1; } }