There will be thousands of columns so it has to be really random.
Thank you very much!
mysql.png 17.45K
31 downloads
mysql.png 17.45K
31 downloads
|
|
|
select `credits` from `table_name` order by rand();
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript
Edited by fayyazlodhi, 11 June 2011 - 12:07 PM.
clearifying
$query_string=mysql_query('asas');
$rows=mysql_num_rows($query_string);
$random_num=mt_rand(0,$rows);
for($i=0; $i<$random_num; $i++) {
$credit_query=mysql_fetch_assoc($query_string);
$credit=$credit_query['credits'];
}
echo $credit;
although random is something that is not always random... thus it still do depend on your random generating algorithm.... this function generates a satisfying random .... but it's not sure.. even in facebook sometimes you see someone 1000 times while never seeing other-one! 0 members, 1 guests, 0 anonymous users