|
|
|
15년 전
|
조회 1,565
|
|
|
|
15년 전
|
조회 1,637
|
|
|
|
15년 전
|
조회 1,432
|
|
|
|
15년 전
|
조회 1,508
|
|
|
|
15년 전
|
조회 1,403
|
|
|
|
15년 전
|
조회 1,721
|
|
|
|
15년 전
|
조회 1,516
|
|
|
|
15년 전
|
조회 1,437
|
|
|
|
15년 전
|
조회 1,185
|
|
|
|
15년 전
|
조회 1,683
|
|
|
|
15년 전
|
조회 1,246
|
|
|
|
15년 전
|
조회 1,293
|
|
|
|
15년 전
|
조회 1,532
|
|
|
|
15년 전
|
조회 1,195
|
|
|
|
15년 전
|
조회 1,602
|
|
|
|
15년 전
|
조회 1,434
|
|
|
|
15년 전
|
조회 1,523
|
|
|
|
15년 전
|
조회 1,774
|
|
|
|
15년 전
|
조회 1,618
|
|
|
|
15년 전
|
조회 1,515
|
댓글 5개
각각 g4_write_{$bo_table} 테이블에서 wr_is_comment = '1' 인거 몽땅 가져오면 되지만..
$que = mysql_query("select bo_table from g4_board wher gr_id = 'A'");
while ( $res = mysql_fetch_object($que) )
{
$que2 = mysql_query("select * from g4_write_{$res->bo_table} where wr_is_comment = '1'");
while ( $res2 = mysql_fetch_object($que2)
{
echo $res2->wr_subject;
}
}
// 테스트 안해봐서 오류날찌도 모름;;
저렇게 하면 몽땅 가져올수는 있지만 테이블이 달라서 정렬도 별로고..
union 으로 해결되겠지만 데이터 많으면 느릴테고..
g4_board_new 테이블에서 wr_id != wr_parent 인 것들이 코멘트니깐
그걸 이용해도 되겠군요
예전에 튜닝할 때 다른방법을 사용한거 같기도 한데.. 기억이 가믈가물;;
$gr_id = "free";
$sql = " select a.wr_id, a.wr_parent, a.bo_table, b.bo_subject from $g4[board_new_table] a, $g4[board_table] b, $g4[group_table] c where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' and a.wr_id != a.wr_parent and c.gr_id = '$gr_id' order by a.bn_datetime desc limit 0, 10 ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$sql = " select * from {$g4['write_prefix']}{$row['bo_table']} where wr_id = '{$row['wr_id']}' ";
$data = sql_fetch($sql);
$data['wr_content'] = str_replace(" ", " ", $data['wr_content']);
$data['wr_content'] = str_replace(" ", " ", $data['wr_content']);
$data['wr_content'] = str_replace("\n", " ", $data['wr_content']);
echo $row['bo_subject']." > <a href='".$g4['bbs_path']."/board.php?bo_table=".$row['bo_table']."&wr_id=".$row['wr_parent']."#c_".$row['wr_id']."'>".cut_str(strip_tags($data['wr_content']), 20, "...")."</a><br>";
}
a.mb_id != 'admin'
을 order by 바로 앞에 추가하면 될꺼 같은데요~