In my small project, when users are registering they select the day in which were born and then using Zeller's congruence I record in my database what day is it.
On the other hand, I want that if a user log in the same day that he was born automatically increases one field of the user, therefore, if he return to log in the same day it doesn't increase.
I have been thinking to put a mark in the day recorded in DB in the first connection if the day match and then when the day change return to set the day correctly do you think it could work.
=====
Another question no related with this: when you use mysql do you always finish with the mysql_close and mysql_free_result?¿
Thank you very much.
Managing a specific connection
Moderator: General Moderators
Re: Managing a specific connection
Re question 1; I don't understand your goal...
Do you want to have something happen if a user logs in on their birthday? and you only want it to happen once?
Why does it matter what day of the week it is?
Do you want to have something happen if a user logs in on their birthday? and you only want it to happen once?
Why does it matter what day of the week it is?
Re: Managing a specific connection
Yes, if a user logs in the same day of the week that he was born it increases a field in the DB of this user, and I also want that this only happen once a week in case that the user connect the same day and only in the first connection if there are more in this day.
For instance:
A user registered selecting this day 1/1/1980 and then I record in the database the day -> Tuesday using Zeller's conguence.
After that if this user logs in on tuesday only in the first connection it will increases the field.
For instance:
A user registered selecting this day 1/1/1980 and then I record in the database the day -> Tuesday using Zeller's conguence.
After that if this user logs in on tuesday only in the first connection it will increases the field.