Fixed config names, added feature documentation to readme

multidb
Thomas Hooge 6 years ago
parent 3944eabdcd
commit f3c949dcb0
  1. 10
      README.md
  2. 4
      syntax.php

@ -1,4 +1,14 @@
# sqlquery
A dokuwiki plugin for processing query to MySQL databases and display results as a table.
This is a improved version which cann connect to different hosts
and databases. The default host and database is set in the plugin
configuration.
Different hosts and databases can be set inside the tag:
```
<sql host=myhost db=mydb>
SELECT foo FROM bar ORDER BY baz
<sql>
```
More information at https://www.dokuwiki.org/plugin:sqlquery

@ -43,13 +43,13 @@ class syntax_plugin_sqlquery extends DokuWiki_Syntax_Plugin {
if (preg_match('/<sql\b.*host=([\w\-\.$]+)/', $match, $result)) {
$data['host'] = $result[1];
} else {
$data['host'] = $this->getConf('host');
$data['host'] = $this->getConf('Host');
}
# get database
if (preg_match('/<sql\b.*db=([\w\-\.$]+)/', $match, $result)) {
$data['db'] = $result[1];
} else {
$data['db'] = $this->getConf('db');
$data['db'] = $this->getConf('DB');
}
# get query
$data['match'] = $match;