How to include global $DB in your file

Re: How to include global $DB in your file

ni Davo Smith -
Number of replies: 0
Larawan ng Core developers Larawan ng Particularly helpful Moodlers Larawan ng Peer reviewers Larawan ng Plugin developers

require_once(__DIR__.'/../../config.php');

(Adjust the number of '/..', based on how many subdirectories are between the file and config.php).

Inside a function you'll need to write:

global $DB;