Return Random Record via MySQL

There are many practical and frequently used methods requiring a random record to be called. For instance, when you see “featured profiles” or random customer comments on a website, they are most likely using a function to call a random record.

In addition, this function can allow you to display data in a random order.

Here’s how it works:

Select Code
SELECT field_1, field_2, field_3, field_4
FROM table_name
WHERE parameter = 1

It’s that simple. Please post your feedback!

One comment on “Return Random Record via MySQL

  1. John says:

    Thanks. I used this to display sponsored ads on my site.
    Only 2 sponsors though 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *