Return Random Records in MySQL
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
- 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.
SELECT product_id, title, description
WHERE active = 1
AND stock > 0
ORDER BY RAND()
ORDER BY RAND() clause returns random records!
This is the hardest thing I've ever had to write, much less admit to myself. I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life. All of those feelings were very...
Back in late 2012 it was not easy to find open source projects using
Google recently debuted a new web service called the Font API. Google's Font API provides developers a means by which they may quickly and painlessly add custom fonts to their website. Let's take a quick look at the ways by which the Google Font...
Remember the Web 1.0 days where you had to customize your site in every way possible? You abused the scrollbars in Internet Explorer, of course, but the most popular external service I can remember was CometCursor. CometCursor let you create and use loads of custom cursors for...