Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1007319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:36:01+00:00 2026-05-16T08:36:01+00:00

I have wondered for a while now how to this. If I want to

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:36:02+00:00Added an answer on May 16, 2026 at 8:36 am

    On a *nix system, use a CRON job. On Windows, it’s Scheduled Task… Either will execute a script at a given time on any (or a specific) day.

    I’d recommend a better table design:

    DROP TABLE IF EXISTS `example`.`stocks`;
    CREATE TABLE  `example`.`stocks` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `name` varchar(45) NOT NULL default '',
      `stock_value` varchar(40) NOT NULL default '',
      `created_date` datetime NOT NULL default CURRENT_TIMESTAMP,
      PRIMARY KEY  (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    

    This way, if you want to see the last 9 values for a given stock name, use:

      SELECT s.name,
             s.value,
             s.created_date
        FROM STOCKS s
       WHERE s.name = ?
    ORDER BY s.created_date DESC
       LIMIT 9
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is something that I have wondered about for a while now. I have
I have wondered/worried about this for a while now, so I thought I'd ask
This is something i have wondered for a while and decided to ask about
I have always wondered about this. So many application setups have a zip file
I have always wondered what's the best way to achieve this task. In most
I wondered if someone might have some insight into this. jqGrid is quite happy
It's the first time I have done anything like this but wondered what the
while playing to this game I wondered how an AI controlling either the detectives
I always wondered how all the programs that has a progress bar can know
Now that Google Drive has launched I wondered if it is possible to integrate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.