mrjameer Posted April 5, 2007 Share Posted April 5, 2007 hi, i want to update a record everyday at a particular time dynamically. how can i do this thanks mrjameer Link to comment https://forums.phpfreaks.com/topic/45772-update-record-at-a-particular-time/ Share on other sites More sharing options...
only one Posted April 5, 2007 Share Posted April 5, 2007 cron, if you dont want to have to visit a page everyday Link to comment https://forums.phpfreaks.com/topic/45772-update-record-at-a-particular-time/#findComment-222335 Share on other sites More sharing options...
shocker-z Posted April 5, 2007 Share Posted April 5, 2007 look into running php from command line http://us3.php.net/features.commandline and then sceduling differs from windows to linux but that's somthing different. Regards Liam Link to comment https://forums.phpfreaks.com/topic/45772-update-record-at-a-particular-time/#findComment-222337 Share on other sites More sharing options...
mrjameer Posted April 5, 2007 Author Share Posted April 5, 2007 hi, when a user will upload files on my site,the file info will be stored in table.and it will also shows a link to the user to download or visit that file.when he visits the link,the counter in table will be incremented.on every day at a particular time i want to update the counter to zero.that's all my code is <?php $current_date=date('Y-m-d'); $current_time=date('H:i:s'); if($current_date && $current_time >= '23:59:00') { mysql_connect($dbServer, $dbUser,$dbPass); mysql_select_db($dbName); $sqlquery="UPDATE images SET count='0'"; $resultquery=mysql_query($sqlquery) or die (mysql_error()); } ?> thanks mrjameer Link to comment https://forums.phpfreaks.com/topic/45772-update-record-at-a-particular-time/#findComment-222357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.