Some cleanup and text improvements

This commit is contained in:
2023-12-01 11:39:55 +01:00
parent de6644302c
commit 399e977b82
10 changed files with 30 additions and 80 deletions

View File

@@ -85,11 +85,11 @@ class syntax_plugin_sqlquery extends DokuWiki_Syntax_Plugin {
$password = $this->getConf('password');
// connect to database
$dsn = "{$data['type']}:host={$data['host']};dbname={$data[db]};charset=UTF-8;";
$dsn = "{$data['type']}:host={$data['host']};dbname={$data[db]};charset=UTF8;";
try {
$dbh = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
$renderer->doc .= "<pre>Unable to connect ro database:" . $e->getMessage() . "</pre>\n";
$renderer->doc .= "<pre>Unable to connect to database:" . $e->getMessage() . "</pre>\n";
return true;
}
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);