Ajout codes retour en code d'erreur

This commit is contained in:
Rodolphe Quiedeville 2003-10-25 10:20:37 +00:00
parent 799bb4f22f
commit 967d9941b3

View File

@ -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;
}
}
/*