This commit is contained in:
Samuel Wolff 2024-01-15 09:39:19 +01:00
parent ab9b8ee706
commit 2b14563643
2 changed files with 28 additions and 0 deletions

View File

@ -36,6 +36,14 @@ class BenutzerController
return json_encode($data);
}
public function nextId()
{
$result = $this->db->nextId();
return json_encode($result);
}
}
?>

View File

@ -94,6 +94,26 @@ class BenutzerModel extends Database
return $result;
}
public function nextId()
{
$pdo = $this->linkDB();
$sql = "SELECT `auto_increment` FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'Benutzerkonto'; ";
try {
$stmt = $pdo->prepare($sql);
$stmt->execute();
} catch (\PDOException $e) {
return false;
}
$result = $stmt->fetchALL(\PDO::FETCH_ASSOC);
return $result;
}
}