title: how to set up daily php functions or mysql queries
body: <p>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. </p>
  
  <p>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.</p>
  
  <p>Maybe something like this for the last 9 days of the stock price curve. </p>
  
  <pre><code>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 '', 
  </code></pre>
  
  <p>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 <code>day_1</code> value and use <code>array_push($array, "new_stock_price");</code> then update the db with the new last_9_days values. </p>