Creating a Variable of Present Date Minus a Past Timestamp
- by John
Hello,
In the code below, "created" is a field in a MySQL table. This field is of the type "timestamp" and the default is set to "CURRENT_TIMESTAMP" of whenever a given row is created.
In the query below, I would like to create a new variable that equals the present date minus the timestamp of "created", rounded off to units of days. I would like the present date to be whenever the query is run.
How could I do this?
Thanks in advance,
John
$sqlStr = "SELECT
l.loginid,
l.username,
l.created,
...