Montag, 25 August 2025

Top 5 diese Woche

Ähnliche Tutorials

Datenbankverbindung

Datenbankverbindung (PDO, sicher)

<?php
$host = "localhost";
$db   = "meine_db";
$user = "root";
$pass = "";

try {
    $pdo = new PDO("mysql:host=$host;dbname=$db;charset=utf8", $user, $pass);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("Verbindung fehlgeschlagen: " . $e->getMessage());
}
?>
Vorheriges Tutorial
Nächstes Tutorial

Hier etwas für dich dabei?