Re: events that i can trigger on intervals.
Sure, that is easy. Just add a column to your room assignment table called something like "RELEASE_TIME", and put into that column the time you want the room to be released. Then, whenever you want to release rooms, execute something like "DELETE FROM ROOM_ASSIGN WHERE RELEASE_TIME > NOW()" or if you mark a status flag, do an update instead of a delete. Since PHP is primarily intended for web applications, it might be better to execute this SQL statement via a Perl script that is triggered automatically as a CRON job, assuming you are using a real operating system like Unix or Linux. If you are using Windows, then you will have a tougher time since the operating system is severely lacking in basic services like true batch jobs, powerful scripting languages, etc. I have been a Windows developer ever since 3.0 came out, and I recently got introduced to the wonderful world of Linux. The differences are staggering. Hope this helps. -Ken At 11:27 PM 6/5/01 +0500, Hasan Niyaz wrote: >Hi, > >I have a room inventory. Clients can block rooms them but I want to >release them after a specified time if they do not release them >normally via the given link. I want to be able to trigger an event to >release the rooms after the time limit. >Is there any way I can do this with MySQL or PHP. > >Thanks, >Hasan > >ps. I use a PHP interface. > > > >- >Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > >To request this thread, e-mail <[EMAIL PROTECTED]> >To unsubscribe, e-mail ><[EMAIL PROTECTED]> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: events that i can trigger on intervals.
Hi, Just wanted to thank everyone for all the suggestions. cheers, Hasan - Original Message - From: "Jeremy Zawodny" <[EMAIL PROTECTED]> To: "Hasan Niyaz" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, June 06, 2001 1:45 AM Subject: Re: events that i can trigger on intervals. > On Tue, Jun 05, 2001 at 11:27:33PM +0500, Hasan Niyaz wrote: > > Hi, > > > > I have a room inventory. Clients can block rooms them but I want to > > release them after a specified time if they do not release them > > normally via the given link. I want to be able to trigger an event > > to release the rooms after the time limit. Is there any way I can > > do this with MySQL or PHP. > > You'll need to use a batch scheduler like cron (on Unix/Linux) to run > a script that does it (or fetch a URL which runs a script that does > it). > > MySQL doesn't have scheduling capabilities built into it (and probably > doesn't need them), so simply need to use a tool that does. > > Jeremy > -- > Jeremy D. Zawodny, <[EMAIL PROTECTED]> > Technical Yahoo - Yahoo Finance > Desk: (408) 349-7878Fax: (408) 349-5454Cell: (408) 439-9951 > > MySQL 3.23.29: up 11 days, processed 68,753,894 queries (71/sec. avg) > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: events that i can trigger on intervals.
Hi! Could this work, I wonder? Have a timestamp field that gets set whenever a person books a room. Then when people look at a room, if the current date is more than a certain amount of time after the timestamp showing, it is EXPIRED. This would be easy to code in PHP. Cheers! -Warren - Original Message - From: "Jeremy Zawodny" <[EMAIL PROTECTED]> To: "Hasan Niyaz" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, June 05, 2001 1:45 PM Subject: Re: events that i can trigger on intervals. > On Tue, Jun 05, 2001 at 11:27:33PM +0500, Hasan Niyaz wrote: > > Hi, > > > > I have a room inventory. Clients can block rooms them but I want to > > release them after a specified time if they do not release them > > normally via the given link. I want to be able to trigger an event > > to release the rooms after the time limit. Is there any way I can > > do this with MySQL or PHP. > > You'll need to use a batch scheduler like cron (on Unix/Linux) to run > a script that does it (or fetch a URL which runs a script that does > it). > > MySQL doesn't have scheduling capabilities built into it (and probably > doesn't need them), so simply need to use a tool that does. > > Jeremy > -- > Jeremy D. Zawodny, <[EMAIL PROTECTED]> > Technical Yahoo - Yahoo Finance > Desk: (408) 349-7878Fax: (408) 349-5454Cell: (408) 439-9951 > > MySQL 3.23.29: up 11 days, processed 68,753,894 queries (71/sec. avg) > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: events that i can trigger on intervals.
On Tue, Jun 05, 2001 at 11:27:33PM +0500, Hasan Niyaz wrote: > Hi, > > I have a room inventory. Clients can block rooms them but I want to > release them after a specified time if they do not release them > normally via the given link. I want to be able to trigger an event > to release the rooms after the time limit. Is there any way I can > do this with MySQL or PHP. You'll need to use a batch scheduler like cron (on Unix/Linux) to run a script that does it (or fetch a URL which runs a script that does it). MySQL doesn't have scheduling capabilities built into it (and probably doesn't need them), so simply need to use a tool that does. Jeremy -- Jeremy D. Zawodny, <[EMAIL PROTECTED]> Technical Yahoo - Yahoo Finance Desk: (408) 349-7878Fax: (408) 349-5454Cell: (408) 439-9951 MySQL 3.23.29: up 11 days, processed 68,753,894 queries (71/sec. avg) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: events that i can trigger on intervals.
On 05-Jun-01 Hasan Niyaz wrote: > Hi, > > I have a room inventory. Clients can block rooms them but I want to > release them after a specified time if they do not release them > normally via the given link. I want to be able to trigger an event to > release the rooms after the time limit. > Is there any way I can do this with MySQL or PHP. > function expire($limit='12 hour') { $qry="UPDATE room_tbl set resvered='no' WHERE reserved='yes' AND res_end < DATE_SUB(NOW(), INTERVAL $limit)"; mysql_query($qry); } Call this function at some useful interval, maybe like just before you check for available rooms. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: events that i can trigger on intervals.
"Hasan Niyaz" writes: >Hi, > >I have a room inventory. Clients can block rooms them but I want to release t >hem after a specified time if they do not release them >normally via the given link. I want to be able to trigger an event to release > the rooms after the time limit. >Is there any way I can do this with MySQL or PHP. Indirectly. If you have another page that clients use to see what rooms are currently available, then at the top of THAT cgi file, first search out and release appropriate rooms, and then select for avail rooms to display. It won't release them AT the time the expiry occurs, but if you check for expiry (and release) before each time you select and display available rooms, you'll get the same effect. --Cindy - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php