Restructure & change a lot of this

This commit is contained in:
Lncvrt committed 2026-08-30 19:14:35 -07:00
1 parent 35865772c1
commit f85bef658b
8 files changed
+140 -132

No files matched your search

+15
View File
@@ -1,4 +1,19 @@
<?php
function formatWithCommas($number) {
return number_format($number, 0, '.', ',');
}
function connectToDatabase() {
include __DIR__ . "/../config/connection.php";
try {
$dsn = "mysql:host=$dbhost;dbname=$dbname;port=$dbport";
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
];
$conn = new PDO($dsn, $dbusername, $dbpass, $options);
} catch (PDOException $e) {
die("Failed to connect to database: " . $e->getMessage());
}
return $conn;
}