You have to have version 3.23 of mysql and then you can add ORDER BY RAND()
to the end of your query.
Alan
-----Original Message-----
From: joe [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2018 4:40 PM
To: MySQL
Subject: Random record
Does anyone have any good ideas on how to pull a random record? I've been
using PHP's random function to create a random number to pull, but the
problem is that if I delete a record, it could still try to pull it. Is
there a better way? I'd really like to be able to just pull it in the SQL
statement instead of pulling a bunch of records then sorting throught that.
Thanks,
JOE
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php