Getting A Random Row From A MySQL Table
Published by philipnorton42 on Wed, 12/26/2007 - 13:07Getting a random row from a MySQL table requires the use of the RAND() function in the ORDER BY clause of the SELECT statement. This will generate a new random number for each row and order them by that new number. In order to get a single row this is combined with the LIMIT clause to limit the result to a single row.
Category:
Add new comment