note 75162 deleted from function.rand by tularis

From: Date: Tue, 15 May 2007 20:19:01 +0000
Subject: note 75162 deleted from function.rand by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-126629@lists.php.net to get a copy of this message
Note Submitter: ---- I don't know if this place is suitable for questions, but I have a problem. I want to create random function that will query a db to fetch a random row from a specific table. The problem is that I don't want this record to be so random. For example, I want to promote a specific banner (the table holds banner paths), so I don't want a specific banner to be displayed totally at random. Rather, I want a random rotation of the banners, but let's say every 2 mines, or 4-5 page refreshes, I would like to force the page display the banner I want to promote. A way to do that, would be to create another table storing the last 5 displayed banners, so, if none of the 5 is the specific one, I would force the banner to be the promoted one. But this seems a lot of work... (creating the table, quering it each time, etc). Isn't there any other way to do this without all these? Thanks for any answer, and sorry if this isn't the right place to post questions.

« previous php.notes (#126629) next »