SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old June 20th, 2003, 02:39 AM
mahesh_r mahesh_r is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 3 mahesh_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old June 20th, 2003, 07:55 AM
mahesh_r mahesh_r is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 3 mahesh_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi any one pls help me with this.

Plsssssssssssss.

THanks

Reply With Quote
  #3  
Old June 20th, 2003, 08:22 AM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
Re: Querying records - pls help

Quote:
Originally posted by mahesh_r

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.

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.

Reply With Quote
  #4  
Old June 20th, 2003, 08:30 AM
mahesh_r mahesh_r is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 3 mahesh_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
At last thanks for replying.

Is there any tutorial on this, adding time and comparing the time with php. Pls help.

THanks

Reply With Quote
  #5  
Old June 20th, 2003, 10:07 AM
alisafwan alisafwan is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: pakistan
Posts: 18 alisafwan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old June 20th, 2003, 12:11 PM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
Quote:
Originally posted by mahesh_r
At last thanks for replying.

Is there any tutorial on this, adding time and comparing the time with php. Pls help.

THanks

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?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Querying records - pls help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway