최신 코멘트 불러올 때 글 제목도 불러오는 법!
최신 코멘트를 아래 sql 구문을 써서 불러오고 있습니다.
$sql = " select * from $tmp_write_table where wr_is_comment = 1 order by wr_id desc limit 0, $rows ";
그런데 글제목은 <?=$list[$i][subject]?> 안나오더라구요.
어떤 글에 달린 코멘트인지 표시하고 싶은데 글제목까지 나오게 하는 법은 없을까요??
$sql = " select * from $tmp_write_table where wr_is_comment = 1 order by wr_id desc limit 0, $rows ";
그런데 글제목은 <?=$list[$i][subject]?> 안나오더라구요.
어떤 글에 달린 코멘트인지 표시하고 싶은데 글제목까지 나오게 하는 법은 없을까요??
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 2개
가져오실려면
$sql = " select * from $tmp_write_table where wr_is_comment = 1 order by wr_id desc limit 0, $rows ";
$result = mysql_query($sql);
while ($row = sql_fetch_array($result))
{
$comment_row = sql_fetch(" select wr_content from $tmp_write_table where wr_id = '".$row[wr_parent]."' and wr_is_comment=0 ");
//부모글 제목
$parent_title = $comment_row[wr_content];
}
이런식으로 받으시면 되겠습니다.