function getMods ($limit) {
global $connect;
$result = $connect->query("SELECT * FROM `image` ORDER BY `id` DESC LIMIT {$limit}");
return resultToArray ($result);
}
if (!$result) {
throw new Exception("Database Error");
}
function resultToArray ($result) {
$array = array ();
while($row = $result->fetch_assoc()) {
$array[] = $row;
return $array;
}
}