최근게시물 new.php 에서 댓글리스트에서 내가 달았는 댓글에 답댓글 갯수(개수) 구하기
최근게시물 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개
10년 전
좋습니다....^^
그리구요...
게시판 분류에서 게시물 갯수를 표시하고 싶은데, 어떻게 방법이 없을까요? 초보라서....^^
그리구요...
게시판 분류에서 게시물 갯수를 표시하고 싶은데, 어떻게 방법이 없을까요? 초보라서....^^
SmudiBra
5년 전
좋은 정보~
게시글 목록
| 번호 | 제목 |
|---|---|
| 3757 | |
| 3747 | |
| 3734 | |
| 3733 | |
| 3721 | |
| 3717 | |
| 3716 | |
| 3709 | |
| 3696 | |
| 3694 | |
| 3656 | |
| 3655 | |
| 3618 | |
| 3595 | |
| 3593 | |
| 3580 | |
| 3559 | |
| 3558 | |
| 3543 | |
| 3539 | |
| 3534 | |
| 3530 | |
| 3527 | |
| 3524 | |
| 3523 | |
| 3514 | |
| 3513 | |
| 3511 | |
| 3507 | |
| 3495 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기