PHP – MySQL order by random


To select random rows from mysql database table, you can use below query:

Here, I’m trying to select a random row from a table in a MySQL database.

Syntax:

SELECT * FROM table_name ORDER BY RAND()

Related Posts: