diff --git a/htdocs/projet/project.class.php b/htdocs/projet/project.class.php
index c7ee99cd467..5e1870904a2 100644
--- a/htdocs/projet/project.class.php
+++ b/htdocs/projet/project.class.php
@@ -44,7 +44,11 @@ class Project {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet (ref, title, fk_soc, fk_user_creat, dateo) ";
$sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid, now()) ;";
- if (!$this->db->query($sql) )
+ if ($this->db->query($sql) )
+ {
+ return $this->db->last_insert_id();
+ }
+ else
{
print ''.$sql.'
'.$this->db->error();
}