ted_chou12 Posted December 31, 2006 Share Posted December 31, 2006 For the convenience, I stored users age as well as their dob, dob is fine, because it stays the same, but age does not, it changes at the dob every year, so is it possible to run a script that automatically updates the age when dob arrives?Thanks Ted Link to comment https://forums.phpfreaks.com/topic/32371-solved-how-to-get-a-php-script-to-run-on-a-specified-date/ Share on other sites More sharing options...
onlyican Posted December 31, 2006 Share Posted December 31, 2006 What I do is only store the users DOB.Then I use my script to work out how old they are, to display on the website.This way, the age is always correct Link to comment https://forums.phpfreaks.com/topic/32371-solved-how-to-get-a-php-script-to-run-on-a-specified-date/#findComment-150322 Share on other sites More sharing options...
ted_chou12 Posted December 31, 2006 Author Share Posted December 31, 2006 then how do you do a mysql search for age range? like 10-19 you can use 1%, but if you only store the dob, you cant do something like that...Ted Link to comment https://forums.phpfreaks.com/topic/32371-solved-how-to-get-a-php-script-to-run-on-a-specified-date/#findComment-150375 Share on other sites More sharing options...
ted_chou12 Posted January 1, 2007 Author Share Posted January 1, 2007 Can anyone help me with my problem? please? thanks, if you have anything that you dont understand, please reply to this. Link to comment https://forums.phpfreaks.com/topic/32371-solved-how-to-get-a-php-script-to-run-on-a-specified-date/#findComment-150599 Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 If you really want to update the age, you could use [b]crontab[/b] (only on Linux) if your host has enabled it, to run [b]linx[/b] (text browser on Linux). Linx can access your website to run the script.Basically, crontab runs a command at specified intervals, so you can go through all the DOBs and update the age of someone if they are older.If you have cPanel, there is a control for crontab. Link to comment https://forums.phpfreaks.com/topic/32371-solved-how-to-get-a-php-script-to-run-on-a-specified-date/#findComment-150602 Share on other sites More sharing options...
ted_chou12 Posted January 1, 2007 Author Share Posted January 1, 2007 thanks :DTed Link to comment https://forums.phpfreaks.com/topic/32371-solved-how-to-get-a-php-script-to-run-on-a-specified-date/#findComment-150605 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.