This repository has been archived on 2026-06-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
sgd/ysqld/ysql07d/kap1/1_5_methode_getAttribute.php
T

26 lines
576 B
PHP

<?php
require("list.php");
try {
$pdo = new PDO("mysql:dbname=$dbname;host=$dbhost;charset=utf8", $dbuser, $dbpw);
} catch (PDOException) {
die ($e->getMassage());
}
$myAttributes = array (
"PDO::ATTR_CLIENT_VERSION",
"PDO::ATTR_CONNECTION_STATUS",
"PDO::ATTR_DRIVER_NAME",
"PDO::ATTR_ERRMODE",
"PDO::ATTR_SERVER_INFO",
"PDO::ATTR_SERVER_VERSION",
);
echo "<ul>\n";
foreach($myAttributes as $attribute) {
echo "<li>" .$attribute .": " .$pdo->getAttribute(constant($attribute)) . "</li>\n";
}
echo "</ul>\n";
?>