최근 15게임 조회하기 sql
function latest_games($game,$mb_id,$count) {
$resutl= array();
$sql = "select a.* , b.po_rel_table as po_rel_table2 from g5_point as a ,g5_point as b
where a.mb_id = '{$mb_id}'
and a.po_rel_id = b.po_rel_id
and a.po_rel_action = b.po_rel_action
and a.po_id != b.po_id
and a.po_rel_table != 'powerball_pick'
and b.po_rel_table != 'powerball_pick'
and a.po_rel_table like 'pwr%'
and b.po_rel_table like 'def%'
and a.po_hidden = ''
and b.po_hidden = ''
group by a.po_id desc
limit 0, {$count}
";
$res = sql_query($sql);
for($i=0;$row=sql_fetch_array($res);$i++){
$result[] =$row;
}
return $result;
}