|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10590 Retrieving Random Rows
Submitted: 2001-05-01 17:25 UTC Modified: 2001-05-01 17:37 UTC
From: marty at webmayhem dot net dot SPAMmeNOT Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.0.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: marty at webmayhem dot net dot SPAMmeNOT
New email:
PHP Version: OS:


 [2001-05-01 17:25 UTC] marty at webmayhem dot net dot SPAMmeNOT
in response to some of the user contributed notes on the 'rand()' function page, a good way to pull a randmon row from a MySql database ( < ver 3.23 ) is:

SELECT field, field*rand() AS ran FROM table ORDER BY ran LIMIT 1

hope it helps.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-01 17:37 UTC]
Not a PHP bug (but thx for the suggestion)

Jani and Derick
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Feb 04 16:05:48 2023 UTC