SQL If nothing is loaded return false, otherwise true

This commit is contained in:
sparkyx 2022-09-14 16:31:07 +02:00
parent 2c300571fa
commit 65b82c0fc0

View file

@ -181,14 +181,14 @@ abstract class Table_Data_SQL extends Data_SQL
// primary cannot be null or empty
if (trim($this->$pk)==="" || $this->$pk===null) {
$this->pk=-1;
return;
return false;
}
$result=$this->cn->get_array($sql,array ($this->$pk));
if ($this->cn->count()==0)
{
$this->$pk=-1;
return;
return true;
}
foreach ($result[0] as $key=> $value)