From 967d9941b3a29bb5bc9c5ea1eaf12eb6f1ae6901 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 25 Oct 2003 10:20:37 +0000 Subject: [PATCH] Ajout codes retour en code d'erreur --- htdocs/product.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/product.class.php b/htdocs/product.class.php index c863e02975c..1bcdeb81817 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -77,8 +77,8 @@ class Product $sql = "INSERT INTO llx_product (datec, fk_user_author, fk_product_type, price)"; $sql .= " VALUES (now(),".$user->id.",$this->type, " . ereg_replace(",",".",$this->price) . ")"; - - if ($this->db->query($sql) ) + $result = $this->db->query($sql) + if ( $result ) { $id = $this->db->last_insert_id(); @@ -91,10 +91,15 @@ class Product return $id; } } + else + { + return -2; + } } else { print $this->db->error() . ' in ' . $sql; + return -1; } } /*