devastator Posted February 4, 2013 Posted February 4, 2013 hi all. i need a kick start to get a sql database tab into customers table to be reset every 24 hours. i think i have to go with a cron job but i have never do this again, thank alll. v2.3.4 Bootstrap Age_rectricted_category_v2.3.1.rar Ajax categories caroussel.rar ajax content.rar Ajax whats new and promo.rar Create Account & Manual Order Maker For OSC 2.3.4 V3.1.rar install seperate taxe pricing..rar
MrPhil Posted February 5, 2013 Posted February 5, 2013 It's not clear to me what you're trying to do. Do you want to perform some fixed SQL operation every 24 hours? You could write an .sql file, and find out from your host what the mysql command line operation would be, and then use cron to fire this off at a fixed time every day. If it's not the same SQL operation each time, you would probably be best off writing a PHP script to borrow osC code to access the database, do whatever reads (selects) and writes (updates) you need to, and cleanly exit. That could be run from cron. In either case, you figure out what you need to run from the Linux command line, and then worry about setting up a cron job. Keep in mind that cron may start with a different environment than you have in the server or via a command line interface, so be prepared to explicitly give all paths and don't assume any environment variables are set for you. Setting up a cron job itself is usally pretty easy -- most control panels have a button and a GUI to guide you through it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.