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
https://forums.phpfreaks.com/topic/104287-disallowing-edits-and-setting-deadlines/
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.

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?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.