Modification de la proc create, renvoie désormais l'id
This commit is contained in:
parent
ffcb34f7d2
commit
fd47881a69
@ -44,7 +44,11 @@ class Project {
|
|||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet (ref, title, fk_soc, fk_user_creat, dateo) ";
|
$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()) ;";
|
$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 '<b>'.$sql.'</b><br>'.$this->db->error();
|
print '<b>'.$sql.'</b><br>'.$this->db->error();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user