DZone voters are special people. Be special. Login and vote now.
By davidwalsh
via davidwalsh.name
Published: Dec 20 2007 / 16:10
The ability to return random records from a MySQL table is invaluable.Returning random records is helpful when: featuring items without showing favoritism to one, testing different result sets in your PHP, and looking to display specific items in a non-specific order. The great part about selecting random records from your MySQL tables is that it's really easy.
Comments
harlan replied ago:
Right on home boy - good post!
daniel replied ago:
I'm not sure I would go so far as to say it's *invaluable*. :-) It's an interesting, if esoteric application of RAND().
Voters For This Link (8)
Voters Against This Link (3)