i think i gotcha... u really have a whole site design u need here huh.

do u know PHP / MYSQL ?

        game_id as PRIMARY INDEX
        game_title VC(100)
        team_1 int (tie to key from teams table)
        team_2 int (tie to key from teams table)
        team_1_points (where u store a 1 for win/draw or a 0 for loss)
        team_2_points (same as tema_1_points)
        deadline int (UNIX timestamp for last possible second to submit)
        status ENUM (some status' for your own use... like OPEN, CLOSED,
        ANY THING ELSE U WANT FOR GAMES. EX... last_modified, time_game_on,
... blah blah

        team_id PRIMARY INDEX
        team_name VC(100)

        tipster_id PRIMARY KEY
        name VC(100) their name or whatever
        points int ... total points that tipster has.

        tip_id PRIMARY KEY
        game_id    ties to the games table
        team_tipped        ENUM (team_1, team_2) for matching to the proper
game fields.
        time_placed     maybe a timestamp to know when they placed the
        status      ENUM(OPEN, CLOSED) etc...

Basic Example....
    Tipster signs up and they get an entry in 'Tipsters'
    Admin creates all the teams add them to 'teams'
    Admin creates games add them to the 'games' table
    Tipsters login and get to 'tip' games that are status'OPEN' from the
games table and deadline hasnt passed
    Your cleanup script processes maybe on 'KRON' to update all games
'CLOSED' and score out the points from the 'placed_tips' table... adding
them to the right 'tipsters' total points.

    we could even break the tables a little more if u wanted say points
scored somewhere else... like a teams and points cross table that can give u
the number of points a 'tipster' has scored total from each individual team
they have 'tipped' in the past.... there are all kinds of possiblities.

That should be it for the DB structure.....
if you are interested in my basic design there. drop me a private Email for
some more.
if not good luck, sounds like a cool project.

    Joel Colombo     [EMAIL PROTECTED]
   Webdevil Studios
    Buffalo, NY

"Jerry" <[EMAIL PROTECTED]> wrote in message
> Hi,
> I am currently running a tipping competition where
> people tip the team they think will win the given game
> or pick the draw.  Each correct entry gets +1 point,
> each incorrect entry gets 0 points.  There is 8 games
> a round and people submit their entries via a PHP page
> that updates a mysql database.  Now for the admin side
> of things, to make it easier for admins to update
> records accordingly without needing to manually add
> them up one by one.
> I want a system I can go into where I select the
> winners of each round.  If a tipster has any matches
> it will credit their accounts +1 for each correct
> entry and 0 for each incorrect entry.  There is 8
> games a round (on a weekend)  .. So how would I get
> the entries to update to the correct amount when I
> select the winners.
> I'd need the admin page to be something like this.
> Game1 : team 1
>         team 2
>         draw
> Game2 : team 3
>         team 4
>         draw
> and so on, Probably a drop down menu to select the
> winner or draw.  So what query would I need or PHP
> code to update the database with +1 for correct
> matches and 0 for incorrect?  Or would I be better to
> have 1 page per game?  I need a safe and reliable way
> of doing it.
> Also I am going to have a tipster tally.  They will be
> in order of total score.  So order will change from
> week to week, how can I auto-sort a list using PHP to
> display on a page without it messing up the score with
> someone else.  So I need the top score to go to the
> top but take the name also and not just the score, any
> ideas?
> For instance:
> Week 1
> bob 7
> judy 6
> Amanda 5
> ....
> Week 2
> Judy 10
> Amanda 9
> bob 8
> From week 1 to 2 bob needs to drop down the bottom,
> Judy needs to move up one and Amanda is to also move
> up one.  I need it to be automatic instead of me
> having to do it manually.  Any ideas?  (I think this
> was discussed about a month ago, if so I appologise
> for the repeat but the help is very appreciated.)
> Lastly the games in the week are different from
> others.  There is normally a Friday night games, a few
> Saturday games and Saturday Night and a few Sunday
> games.  I really don't want to lock people out if they
> don't submit a tip before the first game.  But I do
> want to lock out any tips made for a game that has
> already started.
> For instance:
> It's 8:05 PM and there was a game to start at 7PM I
> want to lock out the tips for the first game but allow
> tips for the remaining games.  How can I lock people
> out?  Sure I could remove the option on the page but
> that does not stop people from loading the page just
> before the start of the game and sitting on it till
> the game has finished and than submitting their tips.
> I need another way, dynamic pages?  Or something else?
>  If the easiest option is to lock people right out
> after the first game has started I will, but I'd
> prefer to not do that.
> Feel free to use any database structure you like, any
> table names are ok.  As long as you define what you
> mean so I can understand what you mean and I can try
> for myself.
> Thanks so much in advance, credit will be given.
> Jerry
> http://mobile.yahoo.com.au - Yahoo! Mobile
> - Check & compose your email via SMS on your Telstra or Vodafone mobile.

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to