Avatar

Question about the notification about inactivity for Micha (Technics)

by Auge ⌂, Friday, May 13, 2022, 08:02 (881 days ago) @ Micha

Hello

In both cases I get a warning.


I think, it is a auto-cast problem.

Yes, you are right.

Please use the data base table instead of this query. Check out the true result using

SELECT
`last_login`,
(`last_login` - (NOW() - INTERVAL 3 YEAR))
FROM `mlf2_userdata`
WHERE `user_lock` = 0
AND `user_type` = 0
AND `inactivity_notification` = FALSE
ORDER BY `last_login` ASC;

I took the query, executed it with and without the user_type and with addition of the name and the (optional) addition of AND `last_login` > (NOW() - INTERVAL 3 YEAR). In every case I get the correct results.

*btw*: IMHO AND `last_login` > (NOW() - INTERVAL 3 YEAR) has a better readability than AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0 even both conditions work.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!


Complete thread:

 RSS Feed of thread