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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.