note 69424 added to function.array-rand

From: Date: Tue, 05 Sep 2006 21:28:23 +0000
Subject: note 69424 added to function.array-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-116725@lists.php.net to get a copy of this message
Instead of looping through all the rows selected to pick a random one, let the server do the work for you: select * from some_table order by rand() limit 1; ---- Server IP: 64.71.164.2 Probable Submitter: 24.106.203.202 ---- Manual Page -- http://www.php.net/manual/en/function.array-rand.php Edit -- https://master.php.net/note/edit/69424 Del: integrated -- https://master.php.net/note/delete/69424/integrated Del: useless -- https://master.php.net/note/delete/69424/useless Del: bad code -- https://master.php.net/note/delete/69424/bad+code Del: spam -- https://master.php.net/note/delete/69424/spam Del: non-english -- https://master.php.net/note/delete/69424/non-english Del: in docs -- https://master.php.net/note/delete/69424/in+docs Del: other reasons-- https://master.php.net/note/delete/69424 Reject -- https://master.php.net/note/reject/69424 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116725) next »