Query a MySQL database server and display the results in a wiki page.
A module called MyPmWiki that allows you to use SQL statements in a wiki page to query a MySQL database and display the results with a table.
Add this script to your "local" directory:
Include it in local.php with:
Set these variables in local.php:
- hostname of the MySQL server (default is "localhost")
- username to access the MySQL server (see caution below)
- password to access the MySQL server (see caution below)
- name of the database to use
- formatting for the table tag (default is "border='1'")
The first and last variables are optional. All others must be set for MyPmWiki to work.
Caution: Unless you want to allow anyone to modify your database, make sure that you set up a user for MyPmWiki that has ONLY select privileges. Also, you must include the unencrypted password for this user in your local.php file. This user should have very limited rights to your MySQL server.
(:MyPmWiki SQL statement:)
(:MyPmWiki SELECT COUNT(*) as Number FROM devtable WHERE ACTION LIKE LOWER('%ipp%'):)
- changed Markup from _begin to inline
- update for PHP 5.5 compatibility
See discussion at MyPmWiki-Talk