|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Querying records - pls help
Hi,
I am design a section in my website, where members of my site can edit a status field. Can some one help me out with this! Listing page- contains a list of records with unique id status confirm page - here the member selects the status and when submits it goes to ---> update status page - here the status is updated and a message is displayed that the record has been updated. For Ex: one member selects a id and goes to next page and selects the status and updates it. I don't want any of other members to access the same record while a member has already take that record/id. I want some kind of lock system so that when a member selects a record, that record should be locked and cannot be updated by others. I read a lot of tutorials from diff sites, but it really din't help me out. Even if i sstore some value in the database to check whether a member is already using the record. i have a problem , what if he closes the browser without updating any thing. Pls someone help me. Thanks Last edited by mahesh_r : June 20th, 2003 at 02:42 AM. |
|
#2
|
|||
|
|||
|
Hi any one pls help me with this.
Plsssssssssssss. THanks |
|
#3
|
|||
|
|||
|
Re: Querying records - pls help
Quote:
When you store the value in the database you need to also store the date and time that the user opened that record. When another user tries to open that same record you check the time the other user opened it and if it is more than say 10 or 20 minutes after the time they opened it and it is not yet closed, you can close it and allow the next user to open that record. If the first user is within the alloted time limit then the new user should get a message saying that record is not available right now.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#4
|
|||
|
|||
|
At last thanks for replying.
Is there any tutorial on this, adding time and comparing the time with php. Pls help. THanks |
|
#5
|
|||
|
|||
|
HI MAHESH bahi
if u refer database rules,your problem can be solved by atomic locking in this method u can define a field in Database having a status flag set when some one accsess the id/record and by using that u can restrict other people to retrive the data related to that perticular ID ali Safwan |
|
#6
|
|||
|
|||
|
Quote:
There could be, but I don't know about it. Its really pretty simple though. If you are using MySql refer to the manual where it talks about the timestamp field. Notice that when any record is updated the first timestamp field in that table gets updated. This is where you should have no problem. I guess you would run into problems if you are not familiar with how to compare two dates in php... for that why don't you take a look around the devarticles site... I'm sure someone has written an article or posted a question about how to compare dates and times. I'd advise you to take some time and understand how you are going to work this problem out and get it done without a tutorial... you will feel much better when you are done... Believe me, I wouldn't send you out to hunt without at least a knife... you will be fine, its not extremely hard. If you do have some trouble with certain syntax please post back and I or someone else will definately help you out. BTW, what is this project for? Personal use, work, just trying it out? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Querying records - pls help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|