hello,
pls help with the folloeing.
I have a table
[users]
id
user_name
date_added
exp_date
the problem is like this:
let's say I add a new user and he's expiration date is 1 year after the day he was added.
In notify.php i want to display the users that there expiration date is in less that 7 days from today's date, because I want to be able to contact them and tell them that they should log in again or something like this.
I know how to display the users in notify.php that have the today() date equal with the expiration date but this doesn't makes me happy.
this should be something like this:
select * from users where ((exp_date - date()) < 7).
I know i didn't explain my self to clear, but i hope you understand.
thx.
notify before expiration date
Moderator: General Moderators
- Think Pink
- Forum Contributor
- Posts: 106
- Joined: Mon Aug 02, 2004 3:29 pm
- Think Pink
- Forum Contributor
- Posts: 106
- Joined: Mon Aug 02, 2004 3:29 pm
notify before expiration date
thx,
but it seems to me that nothing is working. I have the exact problem the guy that started the topic you showed me.
datediff was added in a newer version of mysql that the server has.
and i tried using date_sub, and other functions, but no use. And belive me i read the manual befor posting here.
do you think there is another solution? other than upgrading the mysql.
but it seems to me that nothing is working. I have the exact problem the guy that started the topic you showed me.
datediff was added in a newer version of mysql that the server has.
and i tried using date_sub, and other functions, but no use. And belive me i read the manual befor posting here.
do you think there is another solution? other than upgrading the mysql.
you could do it a different way (longer way but works).
by creating 3 fields...
one field = date to which it was added
second field = date on which to notify.
third field = date of termination.
then you just have to check to see when/if toda's date ever equals the second field or whatever and you can then notify the user...
by creating 3 fields...
one field = date to which it was added
second field = date on which to notify.
third field = date of termination.
then you just have to check to see when/if toda's date ever equals the second field or whatever and you can then notify the user...