wr_last 필드가 가장 마지막 코멘트를 쓴 시간 이지요..
정말 궁금하네요..
|
답변 2개 / 댓글 2개
채택된 답변
+20 포인트
2014-02-07 (금) 23:39:40
$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개
2014-02-08 (토) 12:29:31
2014-02-08 (토) 14:36:55
처음 부터 질문을 그렇게 했으면...
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?>
2018-11-03 (토) 18:52:31
많은 도움이 되었습니다. 감사합니다.
답변을 작성하려면 로그인이 필요합니다.
번호 --- 글제목 ---------- 해당글마지막코멘트 -------------작성자 --- 조회수
1 테스트입니다 마지막작성한코멘트 관리자 1
2 테스트입니다 마지막작성한코멘트 관리자 1
. . . . .
. . . . .
위와 같이 마지막코멘트가 목록에서 각 글의 코멘트를 같이 보여주려고 합니다..
알려주신 코드를 활용해서 어떻게하면 되는지요?