1
0
mirror of synced 2025-12-28 00:23:25 +00:00

feat(login/register) blabla

This commit is contained in:
Valentin
2024-06-10 18:19:34 +02:00
parent f6570e074c
commit 10825d7598
17 changed files with 243 additions and 38 deletions

22
services/db.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
try {
$conn = new PDO("mysql:host=127.0.0.1", "root", "lynqo");
$conn->exec("CREATE DATABASE IF NOT EXISTS subwaySchedule");
$conn->exec("USE subwaySchedule");
$conn->exec("CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
firstName VARCHAR(50) NOT NULL,
lastName VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
is_admin BOOLEAN NOT NULL DEFAULT 0
)");
} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>