It's better when it's simple

User Tools

Site Tools



Compatible with DokuWiki

No compatibility info given!

plugin Processing query to MySQL databases and display results as a JSON

Last updated on

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to sqlquery

Tagged with database, json, mysql, query, sql


This plugin processes a SQL query to a MySQL database and inserts the results as a JSON object. The object will be placed in a <script> tag. The name of the variable holding the JSON object can be passed to the script.

The plugin is based on SQL Query Plugin, please donate to George Pirogov if you like it.


Basic syntax:

<sqljson [objectname]>[query string]</sqljson>
  • query string – SQL query to perform against the database.
  • objectname – name of the variable holding the JSON object, optional (default: “data”)


If the table “table” looks like this:

id text num
1 f 1665456
2 m 1838972
3 123

JSON is generated like this:

<sqljson test>select * from table;</sqljson>

The generated code will look like this:

var test = 
    "text":" ",

Configuration and Settings

The plugin can be configured via the Configuration Manager

Option Description Default value
Host DNS name or IP address of MySQL server localhost
DB MySQL database name (empty)
user MySQL user name (empty)
password MySQL password (empty)

Change Log

  • 2018-07-16
    • Initial release

Discussion, feature requests and bugs

plugin/sqljson.txt · Last modified: 2020-02-23 14:53 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki