php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

Jani and Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC