최근게시물 new.php 에서 댓글리스트에서 내가 달았는 댓글에 답댓글 갯수 구하기.
말로 표현하기가 참 애매하네요.
내가 댓글을 달았을때 거기에 답댓글 달았는 갯수(개수)를 loop 안에서 해당 쿼리로 조회가능할것 같습니다.
찾아도 없어서, 올려나 봅니다.
loop 안에서
[code]
// 댓글 조회
$sql = " select wr_parent, wr_comment, wr_comment_reply from $g5[write_prefix]{$list[$i][bo_table]} where wr_id = '{$list[$i][wr_id]}' ";
$row_cmt = sql_fetch($sql);
$cmt_reply = strlen($row_cmt[wr_comment_reply]);
// 댓글에 답댓글 갯수 조회
$sql = " select count(wr_id) as cnt from $g5[write_prefix]{$list[$i][bo_table]} where wr_parent = '{$list[$i][wr_parent]}' and wr_is_comment = '1' and wr_comment = '$row_cmt[wr_comment]' and length(wr_comment_reply) > $cmt_reply ";
$row10 = sql_fetch($sql);
echo $row10[cnt];
[/code]
말로 표현하기가 참 애매하네요.
내가 댓글을 달았을때 거기에 답댓글 달았는 갯수(개수)를 loop 안에서 해당 쿼리로 조회가능할것 같습니다.
찾아도 없어서, 올려나 봅니다.
loop 안에서
[code]
// 댓글 조회
$sql = " select wr_parent, wr_comment, wr_comment_reply from $g5[write_prefix]{$list[$i][bo_table]} where wr_id = '{$list[$i][wr_id]}' ";
$row_cmt = sql_fetch($sql);
$cmt_reply = strlen($row_cmt[wr_comment_reply]);
// 댓글에 답댓글 갯수 조회
$sql = " select count(wr_id) as cnt from $g5[write_prefix]{$list[$i][bo_table]} where wr_parent = '{$list[$i][wr_parent]}' and wr_is_comment = '1' and wr_comment = '$row_cmt[wr_comment]' and length(wr_comment_reply) > $cmt_reply ";
$row10 = sql_fetch($sql);
echo $row10[cnt];
[/code]
댓글 2개
게시글 목록
| 번호 | 제목 |
|---|---|
| 2937 | |
| 2932 | |
| 2929 | |
| 2928 | |
| 2924 | |
| 2922 | |
| 2909 | |
| 2901 | |
| 2900 | |
| 2896 | |
| 2895 | |
| 2892 | |
| 2884 | |
| 2882 | |
| 2871 | |
| 2858 | |
| 2852 | |
| 2848 | |
| 2841 | |
| 2837 | |
| 2823 | |
| 2820 | |
| 2817 | |
| 2802 | |
| 2790 | |
| 2785 | |
| 2773 | |
| 2757 | |
| 2753 | |
| 2751 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기