2014年8月13日 星期三

隨機從mysql 取出資料

效能不佳
order by rand()

效能較優
$offset = mt_rand(0,$count-1);
$sql = "select * from test limit $offset,1 ";

沒有留言:

張貼留言