Recent Activity



















Database
Compare strings by case
Here’s one method of comparing strings by case in MySQL. You can use the md5 function to hash the...
Force Password Change
Force password change is set in the mdl_user_preferences table with the value auth_forcepasswordc...
Debug Values
The following is a list of the numeric values to set the value of the debug field (either through...
Unix Timestamps
As you start developing in Moodle you'll quickly find that Unix timestamps are used everywhere in...
Query the Grade Scale Value
Grade scales are stored in the mdl_scale table, however they are stored as a comma-separated list...
Dates before Unix Epoch
If you use a custom user profile field with a date and want to store a date that falls before Uni...
Disk Usage by Course
The following query provides a summary of the disk space usage (in bytes) and number of files use...
Query Block Instances and Positions
The following query gives you an idea of all the moodle blocks that have been added to various pa...
Get a list of Site Administrators
The following SQL will help you see which users are site admins in a MySQL/MariaDB database using...
Antelope to Barracuda File Format
During your upgrades or on the Server Environment Checks page, you might see a message like this:...
Assigning Site Administrations through the Database
The following steps can be used to add your user as a siteadmin in the database if required. Ste...
Too Many Connections
When your Moodle database is overloaded you might see errors like this (MySQL/MariaDB) in your PH...
Repeating Rows in MySQL and MariaDB
You might come across a need to repeat a row a set number of times in your SQL. There's an easy w...
Error writing to database field doesn't have a default value
If you receive an error like this, it indicates that your database schema may be missing some def...