PHPilliterate Posted May 5, 2008 Share Posted May 5, 2008 Howdy! I have a site for a baseball league. Currently, users can login to enter their scores after games. This is OK, but need some help. 1) How can I set mysql to disallow editing a score after it has been submitted? Do i do that through php script or mysql? 2) Teams have 14 days to enter their score....how do I lock down records that are more than 14 days past the date the game was played? Any and all help is welcome And in "simple as possible" terms.....my name says it all Quote Link to comment Share on other sites More sharing options...
IsmAvatar Posted May 6, 2008 Share Posted May 6, 2008 1) When you enter something into the database, you "INSERT" it. If it already exists, the INSERT fails. So it wouldn't make any sense to edit or update the information with simply INSERT statements. People can only edit the score if you intentionally code that aspect into it. 2) Simply compare the game date with the current date, and if the difference is > 14 days, reject the changes. What I like to do to make this easier is take the current date, subtract 14 days, and then compare the two. Then it's just a matter of comparing negative versus positive. Quote Link to comment Share on other sites More sharing options...
PHPilliterate Posted May 6, 2008 Author Share Posted May 6, 2008 1) When you enter something into the database, you "INSERT" it. If it already exists, the INSERT fails. So it wouldn't make any sense to edit or update the information with simply INSERT statements. People can only edit the score if you intentionally code that aspect into it. 2) Simply compare the game date with the current date, and if the difference is > 14 days, reject the changes. What I like to do to make this easier is take the current date, subtract 14 days, and then compare the two. Then it's just a matter of comparing negative versus positive. Thanks IsmAvatar 1) Currently, it is the INSERT function that is used. But the problem is that once the score is inserted into the DB, it is still able to be changed. How do I make it so that once a score is entered, the record can not be edited through the web page? 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.