답변 2개
채택된 답변
+20 포인트
11년 전
$row=sql_fetch("select wr_content, wr_name, wr_datetime from $write_table where wr_is_comment = 1 order by wr_datetime desc limit 1");
echo $row[wr_content].'<br>'.$row[wr_name].'--'.$row[wr_datetime];
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
�
토리군
11년 전
�
균이
11년 전
처음 부터 질문을 그렇게 했으면...
for문 다음에 넣으세요
$row=sql_fetch("select wr_content from $write_table where wr_parent='{$list[$i][wr_id]}' and wr_is_comment = 1 order by wr_datetime desc limit 1");
if($row[wr_content]) $comment=cut_str($row[wr_content],30);else $comment=' ';
코멘트 출력 위치에 <?=$comment?>
for문 다음에 넣으세요
$row=sql_fetch("select wr_content from $write_table where wr_parent='{$list[$i][wr_id]}' and wr_is_comment = 1 order by wr_datetime desc limit 1");
if($row[wr_content]) $comment=cut_str($row[wr_content],30);else $comment=' ';
코멘트 출력 위치에 <?=$comment?>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
번호 --- 글제목 ---------- 해당글마지막코멘트 -------------작성자 --- 조회수
1 테스트입니다 마지막작성한코멘트 관리자 1
2 테스트입니다 마지막작성한코멘트 관리자 1
. . . . .
. . . . .
위와 같이 마지막코멘트가 목록에서 각 글의 코멘트를 같이 보여주려고 합니다..
알려주신 코드를 활용해서 어떻게하면 되는지요?