Selecting a Random Row from Table in MySQL


/ Published in: PL/SQL
Save to your folder(s)

Here the simplest way of selecting random rows from the MySQL database with using "ORDER BY RAND()" clause in the query.


Copy this code and paste it in your HTML
  1. ORDER BY RAND()
  2. LIMIT 1

URL: http://www.apphp.com/index.php?snippet=mysql-selecting-random-row

Report this snippet


Comments


You need to login to view comments.