최근게시물 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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 3325 | |
| 3322 | |
| 3321 | |
| 3312 | |
| 3303 | |
| 3297 | |
| 3293 | |
| 3287 | |
| 3281 | |
| 3280 | |
| 3277 | |
| 3267 | |
| 3262 | |
| 3260 | |
| 3258 | |
| 3257 | |
| 3251 | |
| 3248 | |
| 3247 | |
| 3224 | |
| 3203 | |
| 3186 | |
| 3185 | |
| 3181 | |
| 3178 | |
| 3176 | |
| 3170 | |
| 3169 | |
| 3162 | |
| 3152 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기