Managing a specific connection

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
carcaix
Forum Newbie
Posts: 12
Joined: Sun Aug 29, 2010 9:33 am

Managing a specific connection

Post by carcaix »

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.
raccer
Forum Newbie
Posts: 11
Joined: Mon Aug 02, 2010 12:22 pm

Re: Managing a specific connection

Post by raccer »

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?
carcaix
Forum Newbie
Posts: 12
Joined: Sun Aug 29, 2010 9:33 am

Re: Managing a specific connection

Post by carcaix »

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.
Post Reply