RE: [PHP] PHP and MYSQL record locking
| From: | John W. Holmes | Date: | Tue, 03 Jun 2003 17:02:50 +0000 |
| Subject: | RE: [PHP] PHP and MYSQL record locking | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150018@lists.php.net to get a copy of this message | ||
> We have a multi-user database we use for telemarketing. It is used
across
> the internet. All the pages are PHP, I am trying to lock or keep other
> users
> from accessing the same record, so that they do not call the same
lead.
> For
> example, the user selects a zip code to work from and then a lead pops
up,
> once the lead has popped up on the callers screen, I don t want that
same
> lead to pop up on anyone else's screen. So I am not sure if I need to
lock
> the row, or if there is a better way of doing it, since the web
browser is
> stateless. Please any help you can provide would be great, because I
have
> searched the net and haven t found much information. Thank you.
Just add an extra column to keep track of whether the "lead" is being
viewed or not. Set it to 1 when someone views it and then only select
leads where the column is zero.
You'll need a system to control setting it back to zero if need be or
"timing" it out after so long...
---John W. Holmes...
Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/