Hi. I have wondered for a while now how to this. If I want to take weekly backups of all or many of my tables that stores values that changes every day in mysql. I also want to execute daily functions with php that update update values in my db.
I was thinking of making a stock investing function. Where I have fictional data as the value for various stocks, a value that changes randomly every day for every stock.
Maybe something like this for the last 9 days of the stock price curve.
CREATE TABLE `stocks` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(40) NOT NULL default '',
`day_1` varchar(40) NOT NULL default '',
`day_2` varchar(40) NOT NULL default '',
`day_3` varchar(40) NOT NULL default '',
`day_4` varchar(40) NOT NULL default '',
`day_5` varchar(40) NOT NULL default '',
`day_6` varchar(40) NOT NULL default '',
`day_7` varchar(40) NOT NULL default '',
`day_8` varchar(40) NOT NULL default '',
`day_9` varchar(40) NOT NULL default '',
if I could execute a php function once a day that made an array of the last 9 days of values. Then just change the day_1
value and use array_push($array, "new_stock_price");
then update the db with the new last_9_days values.