My goal is to make a column in phpMyAdmin, which counts down the remaining days of a trial period (or something like that).
So for example when I set remainingDays to 30, I want the database to execute the query every 24 hrs
Is it possible to make something like this with only phpMyAdmin in hand, or do I have to put some code onto my website to send MySql Commands to subtract it?
Any help is greatly appreciated.
2
Answers
Are you familiar with
datediff()
? Something like:That is, you can do this in a SQL query.
A better approach would be to have a
startDate
column compute the remaining days during query execution with something like: