전체 최신글에서 게시판 제목을 얻고싶은데
본문
else{ //전체 게시판 출력
$sql_between = " a.bn_datetime between '$term_time' and '".G5_TIME_YMDHIS."' ";
$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b where a.bo_table = b.bo_table and b.bo_use_search = 1 and a.wr_id = a.wr_parent and {$sql_between} ";
$sql_order = " order by a.bn_datetime desc ";
$sql = " select a.*, count(b.bo_subject) as cnt {$sql_common} {$sql_order} limit 0, {$rows} ";
$row = sql_fetch($sql);
if($row['cnt'] > 0){
$sql = " select a.*, b.bo_subject {$sql_common} {$sql_order} limit 0, {$rows} ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++){
$tmp_write_table = $g5['write_prefix'].$row['bo_table'];
$bo_table = $row['bo_table'];
$bo_subject = $row['bo_subject'];
$wr_id = $row['wr_id'];
if($i > 0)
$sql2 .= " union ";
$sql2 .= "(select '{$bo_table}' as bo_table, wr_id, wr_subject, wr_hit, wr_good from {$tmp_write_table} where wr_id = {$wr_id} and wr_datetime between '{$term_time}' and '".G5_TIME_YMDHIS."') ";
}
$sql2 .= " order by ".$options." limit 0, {$rows}";
echo $sql2;
$result2 = sql_query($sql2);
for ($i=0; $row2 = sql_fetch_array($result2); $i++){
$list[$i]['href'] = G5_URL.'/'.$row2['bo_subject'].'/'.$row2['wr_id'];
$list[$i]['subject'] = $row2['wr_subject'];
$list[$i]['name'] = $row2['wr_name'];
$list[$i]['date'] = $row2['wr_datetime'];
$list[$i]['hit'] = $row2['wr_hit'];
}
}
}
위 소스에서 $row2 구간에서
$list[$i]['bo_subject'] 를 사용해서 게시판 제목을 얻고싶습니다.
어떻게 하면 될까요? $list[$i]['bo_subject'] = $row2['bo_subject'] 해도 안나와서요..
!-->
답변을 작성하시기 전에 로그인 해주세요.