I have a bunch of pages on that site for which a page can be served on the database for the site visitor Let's say that visitor arrives at A page B and updates a database to show that they have joined a certain group. Then visitor goes to page C, group page. If user is a member of the group, those member content is shown. If they are not, then non-member content is shown here (BTW, pages are in PHP):
In an ideal world, the query on Page B will be completed immediately at the same time, When the user is always filled with the database before going into page C, the most recent information on the membership states, however, it may be that the server is under a lot of load and the query goes to the user's page Is not complete until the time of Therefore, the user is also a member of the group, although that page does not reflect on C as the query has yet been completed.
Is there a way to do this so that if a user runs a query on a page, then that query does not satisfy any other page, and after the query load is completed, Or until a certain time has passed? I can create this system manually, but if mysql and php already have some built in, then it would be better.
If this is the case, then I am using a LAMP server.
Whether the visitor page can not be shown to only link to the page, unless confirmed in Page B ? Therefore, they can join the group in Page B, which is by submitting a separate intermediate form processor PageFor a form post, and after that one time (i.e., insert mysql successfully completed), it is appropriate to page B Reloads the page with new information and instructions.
If the page C links have to be shown always, or the user can be bookmarked, then the page C can also display the date of the record, if the user records the "Refresh" that Things do not match which he asked for a while to wait and try again.
In any case, in mysql you are talking about concept or line locking but you are trying to apply again on a multi-entry site. I do not know of any such built-in mechanism in PHP, but if you want, you can duplicate it with semaphores per user:
- User initiates action
- PHP sets the lock for that user either by creating a unique file, or by setting a unique key in the memory store such as memory store or in the user session
- indicates that lock is still Not finished
- PHP works (insert mysql, whatever)
- Once the operation is complete and valid, delete the lock
Then you can use the existence of the lock, determine the mobile page C should load the user a few descriptive, such as for a suggestion given above a refresh button.
Comments
Post a Comment