History: Wiki Plugin Development
Source of version: 5 (current)
Copy to clipboard
{syntax type="markdown" editor="wysiwyg"} ## How to access the database from within a Wiki Plugin? There are three ways to access the DB: 1. **$tikilib->query($sql, $attributes);** - This method allows you to utilize any functionality your MySQL username is allowed to use. it returns an AdoDB object. 2. [PluginSQL] 3. [PluginDBReport ] ## Using JQuery JQuery gets included at the bottom of the page, so it isn't accessible in your plugins' template. To access JQuery: 1. Make sure you have the global variable $headerlib defined. 2. Add your JS with $headerlib->add_js( *your js code* ); You won't have the $() syntax. Use $jq() instead.