document.write("
$host = "localhost"; $databaseName = "myDatabaseName"; $username = "myUsername"; $password = "myPassword"; $dsn = "mysql:host=$host;dbname=$databaseName"; try { $databaseConnection = new PDO($dsn, $username, $password); echo "Connection successful."; } catch (PDOException $error) { echo "Connection failed: " . $error; }