Sometimes you want to get the results of your query returned in a random order. We were developing a website that displayed listings of companies which we wanted to display randomly rather that by the date the registered or alphabetically, etc.

Fortunately, mySQL has it already thought out with RAND().

SELECT * FROM companies where somefield=’something’
ORDER BY RAND() 

There you have it….

 

 

contact us
We use WordPress | Find Ireland coupons and discounts snapicity