Select random row from a SQL database.


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

This is by no means the most efficient way to do this, in terms of performance.
It is however the easiest way.


Copy this code and paste it in your HTML
  1. SELECT * FROM `table` ORDER BY rand() LIMIT 1

Report this snippet


Comments


You need to login to view comments.