다중게시판 최신글에서
답변인 글은 안나오거나, 해당글의 밑으로 내려가게 하고 싶습니다.
쿼리문을 어떻게 손보면 될까요? ㅠㅠ
부탁드립니다.
function latest_multi($skin_dir="", $bo_table1, $bo_table2, $bo_table3, $bo_table4, $bo_table5, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
and a.wr_id = a.wr_parent
order by a.bn_id desc
limit $rows ";
답변인 글은 안나오거나, 해당글의 밑으로 내려가게 하고 싶습니다.
쿼리문을 어떻게 손보면 될까요? ㅠㅠ
부탁드립니다.
function latest_multi($skin_dir="", $bo_table1, $bo_table2, $bo_table3, $bo_table4, $bo_table5, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
and a.wr_id = a.wr_parent
order by a.bn_id desc
limit $rows ";
댓글 4개
$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
and a.wr_id = a.wr_parent and b.wr_parent =b.wr_id
order by a.bn_id desc
limit $rows ";
===
and b.wr_parent =b.wr_id
위 조건식을 추가하시면 답변인글은 안나오게 되겠습니다.~
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
and a.wr_id = a.wr_parent and b.wr_parent =b.wr_id
order by a.bn_id desc
limit $rows ";
===
and b.wr_parent =b.wr_id
위 조건식을 추가하시면 답변인글은 안나오게 되겠습니다.~
$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
and a.wr_id = a.wr_parent order by a.bn_id desc
limit $rows ";
앞에 and a.wr_id = a.wr_parent 조건문이 잇었네요 자세히 못보고 답변드려 죄송합니다
위 조건문은 본글만 나오게 하는 조건이라서 원래 올려주신 소스
$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
and a.wr_id = a.wr_parent
order by a.bn_id desc
limit $rows ";
이대로 쓰셔도 답변글은 안나오실꺼 같은데요..
한번 확인해보세요
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
and a.wr_id = a.wr_parent order by a.bn_id desc
limit $rows ";
앞에 and a.wr_id = a.wr_parent 조건문이 잇었네요 자세히 못보고 답변드려 죄송합니다
위 조건문은 본글만 나오게 하는 조건이라서 원래 올려주신 소스
$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
and a.wr_id = a.wr_parent
order by a.bn_id desc
limit $rows ";
이대로 쓰셔도 답변글은 안나오실꺼 같은데요..
한번 확인해보세요
게시글 목록
| 번호 | 제목 |
|---|---|
| 284508 | |
| 284499 | |
| 284492 | |
| 284490 | |
| 284484 | |
| 284481 | |
| 284478 | |
| 284476 | |
| 284474 | |
| 284472 | |
| 284470 | |
| 284458 | |
| 284457 | |
| 284454 | |
| 284453 | |
| 284447 | |
| 284446 | |
| 284444 | |
| 284441 | |
| 284440 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기