diff --git a/public/include/classes/share.class.php b/public/include/classes/share.class.php index 91f47c8fc..47c678139 100644 --- a/public/include/classes/share.class.php +++ b/public/include/classes/share.class.php @@ -112,16 +112,6 @@ public function getSharesForAccounts($previous_upstream=0, $current_upstream) { return $this->sqlError(); } - /** - * Fetch the highest available share ID - **/ - function getMaxShareId() { - $stmt = $this->mysqli->prepare("SELECT MAX(id) AS id FROM $this->table"); - if ($this->checkStmt($stmt) && $stmt->execute() && $result = $stmt->get_result()) - return $result->fetch_object()->id; - return $this->sqlError(); - } - /** * Fetch the highest available share ID from archive **/ diff --git a/public/include/classes/statistics.class.php b/public/include/classes/statistics.class.php index c9de9d24c..22f45c239 100644 --- a/public/include/classes/statistics.class.php +++ b/public/include/classes/statistics.class.php @@ -344,7 +344,7 @@ public function getAllUserShares() { $data['data'][$row['id']]['is_anonymous'] = $row['is_anonymous']; } } - $data['share_id'] = $this->share->getMaxShareId(); + $data['share_id'] = $this->share->getLastInsertedShareId(); return $this->memcache->setCache(STATISTICS_ALL_USER_SHARES, $data); } return $this->sqlError();