- Forums
- MySQL
- Generate A Mysql Results With One Query Order By Random
i will show you in this simple query example how to query the results by random order [932], Last Updated: Sat May 18, 2024
mel
Mon Jul 18, 2011
1 Comments
524 Visits
hi, ok, today i was working on a script using php and mysql, i wanted to query my database and i wanted the order to be listed in a random format. so this is what i did, in this query i will show you.
$Query = "SELECT * FROM mytable WHERE id=23 ORDER BY RAND()";
as you can see, the query will be sorted randomly
https://www.wallpaperama.com/forums/_wxxpre.html