Clean code of not used method

This commit is contained in:
Laurent Destailleur
2022-05-10 14:38:40 +02:00
parent 218749ead4
commit 91d539bbef
3 changed files with 44 additions and 26 deletions

View File

@@ -281,14 +281,17 @@ class Validate
}
foreach ($value_arr as $val) {
$sql = "SELECT ".$col." FROM ".$this->db->prefix().$table." WHERE ".$col." = '".$this->db->escape($val)."'"; // nore quick than count(*) to check existing of a row
$resql = $this->db->getRow($sql);
$sql = "SELECT ".$col." FROM ".$this->db->prefix().$table." WHERE ".$col." = '".$this->db->escape($val)."' LIMIT 1"; // more quick than count(*) to check existing of a row
$resql = $this->db->query($sql);
if ($resql) {
continue;
} else {
$this->error = $this->outputLang->trans('RequireValidExistingElement');
return false;
$obj = $this->db->fetch_object($resql);
if ($obj) {
continue;
}
}
// If something was wrong
$this->error = $this->outputLang->trans('RequireValidExistingElement');
return false;
}
return true;