Buy Sell Discuss UK Domain Names at AcornDomains.co.uk

Today's Drop Dates are: 19-02-2012 or 26-02-2012   All times are GMT. The time now is 12:48:10 PM.
Domain Name Sales Domain Software Calculate UK Domain Drop Dates Domain Registration NameDrive Domain Parking Subscribe to our Domains For Sale newsletter
Go Back   Domain Forum Acorn Domains Buy Sell Auction UK Domains > Website Design and Promotion > Website Design > Scripts and Coding
Connect with Facebook

Scripts and Coding PHP, MySQL, scripts

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 01-12-2011, 02:07:11 PM     #1 (permalink)

 
Nick's Avatar
 
Join Date: Apr 2008
Posts: 730
Nick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond reputeNick has a reputation beyond repute

Nice MYSQL function for randomising

Hi All

I found this solution after a while it seems great and is working for my sites.

Not sure if you could use it for randomising drop lists etc.

Basically it's the random function, but keeps the order 'static' for that day by using a seed.

PHP code is:-

Code:
$var = date("Ymd");

mysql blah blah ORDER BY RAND($var)
Keeps same order until midnight/start of next day where the seed changes hence order will be randomised again (until day after). I use it for displaying products and also related products/popular products etc.

Hope it helps somehow - Nick

Last edited by Nick; 01-12-2011 at 02:09:51 PM.
Nick is online now  
Closed Thread



Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Domain Name Community Replies Last Post
IE9 Cufon / Prettyphoto Problem Aegean Website Design 0 18-04-2011 06:58:26 AM
Save MySQL, Sign the Petition! accelerator General Board 4 11-01-2010 11:10:14 PM
English Dictionary - MySQL Dump expertc Website Design 0 18-11-2009 11:03:51 PM
MySql problems mishmash Scripts and Coding 18 27-06-2008 05:28:32 PM

Domain Sponsor 2


All times are GMT. The time now is 12:48:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0 RC 2
All content on Acorn Domains is member generated and is not moderated before posting. All content is viewed and used by you at your own risk and AD does not warrant the accuracy or reliability of any of the information. The views expressed are those of the individual contributors and not necessarily those of AD. Please contact us to report any issues or send a PM to "Admin".