Re: Not sure how to describe this problem..

From: Date: Tue, 10 Jul 2001 13:30:11 +0000
Subject: Re: Not sure how to describe this problem..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57147@lists.php.net to get a copy of this message
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?

« previous php.general (#57147) next »