Merge pull request #2483 from FHenry/3.7
FIX : fetch actioncomm return 0 if no record found instead of nothing
This commit is contained in:
commit
e777516f38
@ -413,7 +413,8 @@ class ActionComm extends CommonObject
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows($resql))
|
$num=$this->db->num_rows($resql);
|
||||||
|
if ($num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
@ -469,13 +470,15 @@ class ActionComm extends CommonObject
|
|||||||
$this->elementtype = $obj->elementtype;
|
$this->elementtype = $obj->elementtype;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $num;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user