From 583413429532ec02af17c3b2ac16ca844fce7615 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 5 Feb 2004 15:56:57 +0000 Subject: [PATCH] Ajout message d'erreur SQL --- htdocs/commande/commande.class.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 6db2079238d..c7a3e4f0660 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2003 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -387,7 +387,7 @@ class Commande $sql = "SELECT c.rowid, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva"; $sql .= ", ".$this->db->pdate("c.date_commande")." as date_commande, c.fk_projet, c.remise_percent, c.source, c.facture"; $sql .= " FROM ".MAIN_DB_PREFIX."commande as c"; - $sql .= " WHERE c.rowid = $id"; + $sql .= " WHERE c.rowid = ".$id; $result = $this->db->query($sql) ; @@ -426,13 +426,20 @@ class Commande $obj = $this->db->fetch_object(0); $this->propale_id = $obj->fk_propale; } - } - return 1; + return 1; + } + else + { + print $this->db->error(); + print "$sql"; + return -1; + } } else { print $this->db->error(); + print "$sql"; return -1; } }