I agreee that it sounds like you're running into concurrency issues with
mySQL.
I would just adopt a statistical approach, and pick a banner at random each
time...if the random number generator works properly, then you'll get an
even distribution over the universe of available banners.
If you need up update the banner view count, you'll probably still have
concurrency issues unless you lock the table or use transaction support
during the UPDATE command.
- Tim
http://www.phptemplates.org
> I have a chunk of code in a webpage that works like this, to rotate some
> ads.. :
> ...
> So I guess what is happening is that when 2 people hit the page at the
exact
> same time, it's getting updated values out of the DB for some of the ads
> before they are all updated.. how can I go about controlling this?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]