Forum Moderators: open
I was hoping that someone here could help
I am a newbie to databases, been working with them for a little over 6 months and was hoping if someone could tell me if it possible to keep the age of a certain record in a field for that record.
My original plan was to use php to increment the age whenever the script was run, the only problem with that is, if the script wasnt run everyday then the age wouldnt be incremented by one everyday and i want it to be incremented by one every day.
So say a record is a year old, the value of the field for that record would be 365
I have heard of cron and thought about running this php script as a cron job but have since found out that my shared host doesn't let users run scripts as cron jobs, which i suppose is understandable.
So i was thinking if mysql has a mechanism in it that would automatically increment the field by 1 every 24 hours it would be sweet, my plan is to check if the field is greater than a certain amount and after so long have it automatically be deleted. Again the only way i can think of doing this is with php, perhaps there isnt a way in doing it without php and cron but worth a try, if anyone can help please do.
Thanks
ChrisW
PS: if the field can be incremented without php it be nice, thats all im really looking for to be honest, i can run the script to check the value of the field sporadically whenever i log into my system, as long as the field can be incremented automatically by one every 24 hours.