mardi 17 mai 2016

Is there a better way to get Random record with limit 1

Is there a better way to get a random record with limit 1

I am using the below Query

$r = mysql_query("SELECT username FROM user ORDER BY RAND() LIMIT 1");

but this creates a terrible bottleneck to me. Is there a better option to do this.




Aucun commentaire:

Enregistrer un commentaire