note 101167 deleted from function.rand by danbrown

From: Date: Tue, 30 Nov 2010 20:12:45 +0000
Subject: note 101167 deleted from function.rand by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-174493@lists.php.net to get a copy of this message
Note Submitter: khaine at herbok dot org ---- for taking some information randomly from sql $d = mysql_query("SELECT id FROM table_name WHERE id='".$i."'"); for($i=0; $i<=10; $i++) { $b = mysql_fetch_array($d); $c[$i] = $b[id]; } $a = $c[rand(1,10)]; $get_all_data = mysql_fetch_array(mysql_query("SELECT * FROM table_name WHERE id='".$a."'")); echo $get_all_data[id]; echo $get_all_data[name]; echo $get_all_data[message]; etc.

« previous php.notes (#174493) next »