[thelist] PHP/MySQL order by rand()

noah noah at tookish.net
Sat Jan 4 03:02:01 CST 2003


At 01:11 AM 03/01/2003, I wrote:
>SELECT * FROM quotation ORDER BY RAND() LIMIT 1
>
>always returns the last row when done from a PHP page (it works fine from
>the command line).

(Responding to my own post for the sake of the archives.)

This appears to be a MySQL on Windows bug. Other people have encountered it
(see <http://groups.google.com/groups?q=mysql+bug+windows+rand>), and the
script worked properly when I ran it in Linux.

Cheers,
Noah




More information about the thelist mailing list