note 61084 added to function.rand

From: Date: Wed, 25 Jan 2006 10:48:04 +0000
Subject: note 61084 added to function.rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-102410@lists.php.net to get a copy of this message
About selecting random row from a MySQL table (much faster thand MySQL's rand function: $tot=mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM sometable WHERE (condition)")); $row=rand(0,$tot); $res=mysql_fetch_row(mysql_query("SELECT * FROM sometable WHERE (condition) LIMIT $row,1")); ---- Server IP: 195.222.164.18 Probable Submitter: 80.240.209.20 ---- Manual Page -- http://www.php.net/manual/en/function.rand.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61084 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61084&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61084&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61084&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61084&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61084&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61084&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61084&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61084&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102410) next »