public function deleteSpecies($tid) { if (is_numeric($tid)) { $sql = 'UPDATE taxa t SET t.SecurityStatus = 0 WHERE (t.tid = ' . $tid . ')'; //echo $sql; $this->con->query($sql); //Update specimen records $sql2 = 'UPDATE omoccurrences o INNER JOIN taxstatus ts1 ON o.tidinterpreted = ts1.tid ' . 'INNER JOIN taxstatus ts2 ON ts1.tidaccepted = ts2.tidaccepted ' . 'INNER JOIN taxa t ON ts2.tid = t.tid ' . 'SET o.LocalitySecurity = 0 ' . 'WHERE (t.tid = ' . $tid . ')'; //echo $sql2; exit; $this->con->query($sql2); $occurUtil = new OccurrenceUtilities(); $occurUtil->protectGloballyRareSpecies(); } }