static function deleteByClefunique($clefunique) { $query = "select distinct idserie as idserie from torrentserie "; $query .= "where clefunique=" . \core\Mysqli::real_escape_string_html($clefunique); \core\Mysqli::query($query); $tfs = \core\Mysqli::getObjectAndClose(true); $query = "delete from torrentserie "; $query .= "where clefunique=" . \core\Mysqli::real_escape_string_html($clefunique); \core\Mysqli::query($query); $res = \core\Mysqli::nombreDeLigneAffecte() > 1; \core\Mysqli::close(); foreach ($tfs as $k => $tf) { $query = "select count(*) as cpt from torrentserie "; $query .= "where idserie=" . \core\Mysqli::real_escape_string_html($tf->idserie); \core\Mysqli::query($query); $re = \core\Mysqli::getObjectAndClose(); if ($re->cpt === "0") { $res &= Serie::delete($tf->idserie); } } return $res; }