SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Resident Boozehound simontheak's Avatar
    Join Date
    Jun 2003
    Location
    _root.europe.uk.london
    Posts
    965
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Storing data for the last five days

    Hi there,

    I'm looking to build a database which will integrate with something like FusionCharts. Therefore, I'll be storing data over a weekly period to display in the relevant graph.

    However, I've got a couple of questions about the best way to set this up:

    • How should the fields be labelled in the database? Just something generic like 'Day 1' through to 'Day 7'?
    • How do I ensure that the PHP script enters the right value in the right field? Is there some way of saying in PHP insert the value into 'the next available field?'
    • And equally what would you recommend I do at the end of each week? Just overwrite the data? Or store it in a separate table somewhere?


    Thanks a lot in advance,

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    a column for each day will give you more problems than you want

    enter each day's data into its own row, with the date as part of the key
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    Resident Boozehound simontheak's Avatar
    Join Date
    Jun 2003
    Location
    _root.europe.uk.london
    Posts
    965
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah ok - so therefore if I was tracking the value of stocks for example, would the best option to be to have the date entered into each row as you suggest with the each company name having its own separate column?

    Thanks a lot for your help!

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    no

    company would be part of the key as well
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •