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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Mar 13 17:01:30 2025 UTC