Fixed config names, added feature documentation to readme

This commit is contained in:
Thomas Hooge 2018-12-10 14:56:37 +01:00
parent 3944eabdcd
commit f3c949dcb0
2 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,14 @@
# sqlquery # sqlquery
A dokuwiki plugin for processing query to MySQL databases and display results as a table. 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 More information at https://www.dokuwiki.org/plugin:sqlquery

View File

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