Instead of pulling using equals, ie "select * from table where id =
$php_random_variable" you can do this instead "select * from table where id
<= $php_random_variable LIMIT 1"... As long is there is atleast one row in
the table you will get back a result. Hope that helps.
ryan
----- Original Message -----
From: "joe" <[EMAIL PROTECTED]>
To: "MySQL" <[EMAIL PROTECTED]>
Sent: Sunday, February 25, 2018 5:39 PM
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