How to access the database from within a Wiki Plugin?
There are three ways to access the DB:
- $tikilib->query($sql, $attributes); - This method allows you to utilize any functionality your MySQL username is allowed to use. it returns an AdoDB object.
- PluginSQL
- PluginDBReport
Using JQuery
JQuery gets included at the bottom of the page, so it isn't accessible in your plugins' template. To access JQuery:
- Make sure you have the global variable $headerlib defined.
- Add your JS with $headerlib->add_js( your js code );
You won't have the $() syntax. Use $jq() instead.