Fix: $result non défini

This commit is contained in:
Regis Houssin 2007-05-05 14:04:40 +00:00
parent 402cf66d0d
commit aa10b55229

View File

@ -1710,11 +1710,13 @@ class Propal extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as c";
$sql.= " WHERE c.rowid = $id"; $sql.= " WHERE c.rowid = $id";
if ($this->db->query($sql)) $result = $this->db->query($sql);
{
if ($this->db->num_rows()) if ($result)
{ {
$obj = $this->db->fetch_object(); if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid; $this->id = $obj->rowid;
@ -1727,22 +1729,22 @@ class Propal extends CommonObject
$this->user_creation = $cuser; $this->user_creation = $cuser;
if ($obj->fk_user_valid) if ($obj->fk_user_valid)
{ {
$vuser = new User($this->db, $obj->fk_user_valid); $vuser = new User($this->db, $obj->fk_user_valid);
$vuser->fetch(); $vuser->fetch();
$this->user_validation = $vuser; $this->user_validation = $vuser;
} }
if ($obj->fk_user_cloture) if ($obj->fk_user_cloture)
{ {
$cluser = new User($this->db, $obj->fk_user_cloture); $cluser = new User($this->db, $obj->fk_user_cloture);
$cluser->fetch(); $cluser->fetch();
$this->user_cloture = $cluser; $this->user_cloture = $cluser;
} }
} }
$this->db->free(); $this->db->free($result);
} }
else else