<?php
// datenbank heißt absichtlich lernenjahr2 und nicht benutzer_verwaltung
try {
$pdo = new PDO("mysql:host=localhost;dbname=lernenjahr2","root","deinPasswort");


// Tabelle erstellen
$createTable = $pdo ->exec('CREATE TABLE IF NOT EXISTS `user`(
    id INTEGER AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(255),
    email VARCHAR(255),
    created_at TIME,
    status VARCHAR(30)
);');
echo "TABLE CREATED (IF NOT EXISTS) <br>";

// CREATE USER
$createUser = $pdo ->exec('INSERT INTO user VALUES(
    null,
    "danielvici223",
    "daniel@danielvici.com",
    "11:00:00",
    "active"
);');

echo "USER CREATED <br>";
// update haben wir nicht gemacht

// DELETE USER
$deleteUser = $pdo ->exec('DELETE FROM user WHERE id=1');

// pagination <- keine was das ist?
echo "USER 1 DELETED <br>";


} catch (PDOException $e) {
    echo "". $e ."";
}

?>