Jump to content

Disallowing edits and setting deadlines


PHPilliterate

Recommended Posts

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  ;)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.