Ajout codes retour en code d'erreur
This commit is contained in:
parent
799bb4f22f
commit
967d9941b3
@ -77,8 +77,8 @@ class Product
|
|||||||
|
|
||||||
$sql = "INSERT INTO llx_product (datec, fk_user_author, fk_product_type, price)";
|
$sql = "INSERT INTO llx_product (datec, fk_user_author, fk_product_type, price)";
|
||||||
$sql .= " VALUES (now(),".$user->id.",$this->type, " . ereg_replace(",",".",$this->price) . ")";
|
$sql .= " VALUES (now(),".$user->id.",$this->type, " . ereg_replace(",",".",$this->price) . ")";
|
||||||
|
$result = $this->db->query($sql)
|
||||||
if ($this->db->query($sql) )
|
if ( $result )
|
||||||
{
|
{
|
||||||
$id = $this->db->last_insert_id();
|
$id = $this->db->last_insert_id();
|
||||||
|
|
||||||
@ -91,10 +91,15 @@ class Product
|
|||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $this->db->error() . ' in ' . $sql;
|
print $this->db->error() . ' in ' . $sql;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user