Bug #10590 Updated: Retrieving Random Rows

From: Date: Tue, 01 May 2001 21:37:20 +0000
Subject: Bug #10590 Updated: Retrieving Random Rows
Groups: php.dev 
Request: Send a blank email to php-dev+get-53244@lists.php.net to get a copy of this message
ID: 10590 Updated by: derick Reported By: marty@webmayhem.net.SPAMmeNOT Old-Status: Open Status: Bogus Bug Type: MySQL related PHP Version: 4.0.5 Assigned To: Comments: Not a PHP bug (but thx for the suggestion) Jani and Derick Previous Comments: --------------------------------------------------------------------------- [2001-05-01 17:25:29] marty@webmayhem.net.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. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10590&edit=2

« previous php.dev (#53244) next »