Thank you, Peter and all.  This has been of great help.  


Justin Palmer

-----Original Message-----
From: Peter Westergaard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 15, 2004 6:48 AM
Subject: Re: [PHP-DB] Re: Hold System

> In the example of Bob, Mary and Barbara that I gave in my last post.  
> If Bob cancels his hold and I reset date_held for mary to the current 
> date, so that she has adiquite time to place her student.  If I do 
> that this will put Barbara into the #1 position because she has now 
> put a hold before Mary.
> With this beig the case, would the best solution be to recursively go 
> through the others holding the student(Mary and Barbara), and set 
> Mary's date_held to now, and Barabara's date_held to a minute after (a

> time which has most likely has not occurred yet) Mary's.

I'd simply go by your date_created (and I'm assuming that's a timestamp
of some kind with minute or second granularity).  Leave that to the time
the record was created.  Then, by definition, the "#1 position" is

SELECT * FROM hold_tracker
WHERE STUDENT_ID = {whatever} AND valid = 1
ORDER BY date_created ASC

No need to update anybody's record except Bob's (when it is expired or
cancelled), and Mary's (to indicate when her time window opens).
Barbara's record shouldn't need any sort of touching whatsoever.  No

Unless you meant date_created to be the date they created the firm
not the date they placed the request for a hold.   In which case you
substitute 'id', since it will number everything sequentially by order
of receipt anyhow.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to