comment_update.php에 누락된 부분... > 지블로그 질답

지블로그 질답

comment_update.php에 누락된 부분... 정보

comment_update.php에 누락된 부분...

본문

원본
------------------------------------------------------------ 
        // 글 정보 테이블에 댓글 카운트를 증가시킨다.
        $sql = "update {$gb4['post_table']} set comment_count = comment_count + 1 where blog_id='{$current['id']}' and id='{$post_id}'";
        sql_query($sql);
------------------------------------------------------------ 
수정
------------------------------------------------------------ 
       // 글 정보 테이블에 댓글 카운트를 증가시킨다.
        $sql = "update {$gb4['post_table']} set comment_count = comment_count + 1 where blog_id='{$current['id']}' and id='{$post_id}'";
        sql_query($sql);
 
        // 블로그 정보 테이블에 댓글 카운트를 증가시킨다.
        $sql = "update {$gb4['blog_table']} set comment_count = comment_count + 1 where id='{$current['id']}'";
        sql_query($sql);
------------------------------------------------------------ 
 
기본스킨에서는 <?=$current[comment_count] ?>를 끌어다 쓰지 않아 해당사항 없음...
 
<?=$current[comment_count] ?>를 끌어다 쓸 경우
위에서 추가된 부분이 없으면  gb4_blog테이블에 삭제할때 코멘트카운트가 -1 되는 반면 등록할때는 코멘트카운트가  +1 되지않으므로 데이터의 정확성에 어긋남...
 
gb4_blog 테이블내의 트랙백 카운트도 그러한지 확인중....
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로