need help implementing a live update feature

Discussion in 'Web Design and Development' started by sk3pt1c, Jun 11, 2010.

  1. sk3pt1c macrumors 6502a

    sk3pt1c

    Joined:
    Nov 29, 2005
    Location:
    a simulacrum
    #1
    hello guys and dolls,
    so...
    let me explain this as best i can:

    there's a site we're planning on making for a bunch of people organizing a paintball "championship".

    as you might imagine, each leg has games between the teams.
    after each game the teams are awarded points for the result as well as points for "bodies".
    for example, if you win you get three points, if it's a tie you get one, if you lose you get zero.
    if you won and have 4 out of 5 players "live" at the end of the game, you get a +4 "body" count as well.
    game points and "body" points are not added one with the other, they're kept as separate scores and
    are summed up respectively after each game.
    i hope i've made that as clear as possible.

    so, the idea is, someone's standing by next to the field to get the score after each game and somehow (iphone, laptop with 3g connection) posts the game's score on the website, where it shows up on a page on a "scores" table so people not attending the event can keep track of what's going on.

    it would be preferable if the table's set up to keep a total for each team and update that after each input.
    also, perhaps the order of the teams could be rearranged on the fly depending on total score?

    this could also serve to keep the teams at the event up to date by way of a big screen tv showing that specific section of the website.

    this already sounds pretty complicated to me, which either means it actually is or that i'm too much of a noob when it comes to such things. nonetheless, if it's doable, i'm more than willing to learn how to do it, i pick up things rather fast and am always keen to learn new stuff :)

    so, if anyone can help or point me in the right direction, i'd be more than happy! :)

    thanks for your time :D
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    It can be done with PHP and MySQL. If MySQL is not an option you could use some file method of tracking information, perhaps in CSV (comma separated values) format or maybe even use SQLite, which is file-based.
     
  3. sk3pt1c thread starter macrumors 6502a

    sk3pt1c

    Joined:
    Nov 29, 2005
    Location:
    a simulacrum
    #3
    I have done some php / postgresql in the past so i'm up for a mysql challenge and it's deffo an option as far as the provider is concerned.

    Could you help me out with the logistics of information?

    Maybe set up a form to take the scores, have them written in a table and use some queries to pull and display the table data every 5 mins or something?
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
  5. sk3pt1c thread starter macrumors 6502a

    sk3pt1c

    Joined:
    Nov 29, 2005
    Location:
    a simulacrum
    #5
    Thanks for the links!:)
    nevertheless, it's the logistics and/or logic of the problem that i'm asking for help with, not the proper syntax for the code :)
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    You original post lays it out pretty well.

    • You'll have a DB table that holds score information.
    • You'll have a web page with a form that allows adding new scores.
    • You'll eventually have web forms that allow editing or deleting scores.
    • You'll have a page that pulls data from the DB and shows high scores (ordered) or shows data by team.
    • The page can auto-update every so often by either using a meta tag refresh or using JavaScript.
     
  7. sk3pt1c thread starter macrumors 6502a

    sk3pt1c

    Joined:
    Nov 29, 2005
    Location:
    a simulacrum
    #7
    thank you!
    i've done it in 3 files,
    the first is a form that provides the user with a dropdown to select a team (so as to avoid misspellings and so on), which is pulled from the first field (column) of a database table that i've already filled in, and two boxes for points and "bodycount".
    this sends the data over to the second page which updates the database table.
    then the user is given the option of going to the results page or back to post more scores.
    and for the results page i basically pull all the data from the table sorted by score first and "bodycount" after.
    i have to remember to set this page to refresh every five minutes.
    i will try to make it prettier and perhaps add a log-in so that not everyone can post scores :)

    thanks again for the help! :)
     

Share This Page