sws Posted November 30, 2006 Share Posted November 30, 2006 Hi,I have created a sports pool in which the user uses a form to make a bunch of player selections. When they submit the form their picks are entered into my database. I'm now trying to take it to the next step.Currently, the form can be filled out over and over again but I want it so that the user must submit picks each week by Sunday night 11:59 pm (Pacific time). Once they've submitted their picks for the week, they can not change their picks for the week. After 11:59 pm each Sunday night, I want the form to be disabled.The form will then be enabled again each Saturday from 11:59 PST to Sunday night 11:59 pst for user's to enter their picks for the upcoming week.Any suggestions on how to accomplish this ? Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 30, 2006 Share Posted November 30, 2006 First off, I'm going to assume your users have a UserID. I'm also going to assume the possible selections also have an ID, I'll call it PickID. I would use a table structure like this:table: [b]PickTrack[/b]TrackID INT AUTO INC etcUserID INTEnterTime DATETIMEtable: [b]PickTrackItems[/b]TrackID INTPickID INTUNIQUE(TrackID, PickID)When a user makes their selections, you make a single entry in [b]PickTrack[/b] with the times that the selection was made. You then enter all of the selected picks into [b]PickTrackItems[/b] and attach them to the single entry from the previous table.When a user visits this page, you can calculate the timestamp of the exact cutoff date for this week as well as one week ago. If no entry in [b]PickTrack[/b] between those dates exists for the user you can display the form. Quote Link to comment Share on other sites More sharing options...
sws Posted November 30, 2006 Author Share Posted November 30, 2006 Thanks. Sounds like a good solution.I am using a user id and a pick id (which is basically the player id for each player... tied back to the players table). I'm plugging this all into just one managers table right now though. Then on the page that displays the standings I pull the data from the managers and players table and display it.I'll break it up into two tables: a picktrack table and a picktrackitems table.Does this mean that my managers table will just contain the username and the unique id ? So essentially I'll have 3 tables ?I have to plan ahead for when I add other pools. The manager will be allowed to enter several different pools but can only enter each pool once. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.