Occasionally I post some MySQL queries on Moodle.org I’ve found useful administering Moodle sites.
Here’s a nice simple query, but very useful for a quick check on who’s been logging into your site recently.
SELECT id,username,FROM_UNIXTIME(`lastlogin`) AS days FROM `prefix_user` WHERE DATEDIFF(NOW(),FROM_UNIXTIME(`lastlogin`) ) < 7
If you don’t know how to use a query like this in your Moodle site don’t worry, I’m gong to be posting some hints and tips on how to use MySQL queries with Moodle over the coming months. And if you DO know how to query your database, you can use and easily adapt this query
Latest posts by Stuart Mealor (see all)
- Using an iPad for real, part 3 – Apps – 14th September 2019
- Moodle plugin of the month – Buttons course format – 12th September 2019
- Linux for new users part 4 – dates – 9th September 2019