리스트에서 댓글 출력

리스트에서 댓글 출력

QA

리스트에서 댓글 출력

답변 3

본문

아래 쿼리는 뷰페이지에서 댓글 출력하는 코드인데요
리스트에서 각 게시글에 해당되는 댓글이 출력 되려면
어떻게 수정해야 될까요


// 코멘트 출력

//$sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";

$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";

$result = sql_query($sql);

for ($i=0; $row=sql_fetch_array($result); $i++)

{

    $list[$i] = $row;
}

이 질문에 댓글 쓰기 :

답변 3

lisk.skin.php 파일의
for ($i=0; $i<count($list); $i++) { 문 아래에
$ex_wr_id = $list[$i][wr_id];
$sql = " select * from $write_table where wr_parent = '$ex_wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
이런 식으로 불러오고 추가로 코딩해야 될것 같은데요 

wr_parent = '{$wr_id}' ---> wr_parent = '{$list[$i][wr_id]}'

 

for ($i=0; $row=sql_fetch_array($result); $i++)

{

    $list[$i] = $row; ----> $list2[$i] = $row;

댓글 출력은 $list2를 사용 

네 말씀대로 하는데 각글에 댓글보기 클릭해 보시면 아시겠지만 똑같이 출력이 되네요..
각 글마다 댓글 작성하면 해당 글에 것이 출력이 되어야 하는데..
http://ymik.cafe24.com/bbs/board.php?bo_table=best_vote

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 7
© SIRSOFT
현재 페이지 제일 처음으로