prepare("SELECT id FROM users WHERE username = 'admin'"); $stmt->execute(); if ($stmt->fetch()) { echo "Admin user already exists.\n"; } else { $username = 'admin'; $password = 'password'; // You should change this! $hashed_password = password_hash($password, PASSWORD_DEFAULT); $role = 'super_admin'; $stmt = $pdo->prepare("INSERT INTO users (username, password, role) VALUES (:username, :password, :role)"); $stmt->bindParam(':username', $username); $stmt->bindParam(':password', $hashed_password); $stmt->bindParam(':role', $role); $stmt->execute(); echo "Default admin user created with username 'admin' and password 'password'.\n"; } } catch (PDOException $e) { die("DB ERROR: " . $e->getMessage()); }