私は500の結果を持つテーブルを持っています。order_by&limitでCodeIgniterを10で5つのランダムな結果を選択しますか?
私はDESCオプションのプレーヤーで注文し、10個の結果を限る必要があり、CodeIgniterで10個の結果を5つ選択する必要があります。
私が持っているもの:
public function getServers(){
$this->db2->from('server');
$this->db2->order_by("players", "desc");
$this->db2->limit(5);
$query = $this->db2->get();
if ($query->num_rows() > 0) {
foreach ($query->result() as $row) {
$data[] = $row;
}
return $data;
}
return false;
}
ようこそスタックオーバーフロー!あなたは[ツアーをすることができます](http://stackoverflow.com/tour) –