note 102045 added to function.rand

From: Date: Tue, 25 Jan 2011 04:58:01 +0000
Subject: note 102045 added to function.rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-176271@lists.php.net to get a copy of this message
@Jesse, if you want pick a random record from database, you do not have a random number and then find it, you can use the RAND(): <?php $zapytanie = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT X"; ?> Białko ---- Server IP: 82.177.164.100 Probable Submitter: 77.253.239.42 ---- Manual Page -- http://www.php.net/manual/en/function.rand.php Edit -- https://master.php.net/note/edit/102045 Del: integrated -- https://master.php.net/note/delete/102045/integrated Del: useless -- https://master.php.net/note/delete/102045/useless Del: bad code -- https://master.php.net/note/delete/102045/bad+code Del: spam -- https://master.php.net/note/delete/102045/spam Del: non-english -- https://master.php.net/note/delete/102045/non-english Del: in docs -- https://master.php.net/note/delete/102045/in+docs Del: other reasons-- https://master.php.net/note/delete/102045 Reject -- https://master.php.net/note/reject/102045 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#176271) next »