최근게시물 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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 2537 | |
| 2536 | |
| 2532 | |
| 2526 | |
| 2524 | |
| 2522 | |
| 2519 | |
| 2507 | |
| 2506 | |
| 2505 | |
| 2499 | |
| 2484 | |
| 2475 | |
| 2474 | |
| 2468 | |
| 2467 | |
| 2465 | |
| 2461 | |
| 2456 | |
| 2454 | |
| 2453 | |
| 2448 | |
| 2445 | |
| 2444 | |
| 2441 | |
| 2435 | |
| 2433 | |
| 2431 | |
| 2430 | |
| 2424 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기