특정게시판 댓글 삭제

게시물 검색을 해서 아래의 방법을 알아서 실행하니까 오류가 나네요

<?
// 코멘트 삭제
include_once("./_common.php");

$write_table = 삭제하기 원하는 테이블명;

$res = sql_query(" select * from $write_table where wr_comment > 0 order by wr_id desc ");

while($row=sql_fetch($res)){

$gd_qry = " delete from $write_table where wr_parent = '$row[wr_id]' and wr_is_comment > 0 ";

mysql_query($gd_qry);
}

?>


(테이블명 : back ) 이라고 입력했는데 아래와 같이 오류가 뜨는데 해결방법좀 알려주세요.
--------------------------

select * from back where wr_comment > 0 order by wr_id desc

1146 : Table 'naomi.back' doesn't exist

error file : /board/del.php

------------------------------
|

댓글 3개

<?
// 코멘트 삭제
include_once("./_common.php");

$write_table = g4_write_back ;

$res = sql_query(" select * from $write_table where wr_comment > 0 order by wr_id desc ");

while($row=sql_fetch($res)){

$gd_qry = " delete from $write_table where wr_parent = '$row[wr_id]' and wr_is_comment > 0 ";

mysql_query($gd_qry);
}

?>

위에 처럼 수정했는데 아래와 같이 오류가 뜨네요 ㅠ.ㅠ

--------------------------------------------------------------------------
Resource id #13

1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #13' at line 1

error file : /board/del.php
while($row=sql_fetch($res)){

===>

while($row=sql_fetch_array($res)){
<?
// 코멘트 삭제
include_once("./_common.php");

$write_table = g4_write_back ;

$res = sql_query(" select * from $write_table where wr_comment > 0 order by wr_id desc ");

while($row=sql_fetch_array($res)){

$gd_qry = " delete from $write_table where wr_parent = '$row[wr_id]' and wr_is_comment > 0 ";

mysql_query($gd_qry);
}

?>

이렇게 바꾸 었는데 이번에는 아무런 반응도 없네요.. ㅠ.ㅠ
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
17년 전 조회 1,530
17년 전 조회 2,088
17년 전 조회 1,767
17년 전 조회 1,554
17년 전 조회 1,660
17년 전 조회 1,817
17년 전 조회 1,608
17년 전 조회 2,194
17년 전 조회 1,550
17년 전 조회 1,908
17년 전 조회 1,630
17년 전 조회 1,735
17년 전 조회 1,948
17년 전 조회 2,061
17년 전 조회 2,264
17년 전 조회 1,510
17년 전 조회 1,890
17년 전 조회 1,908
17년 전 조회 2,454
17년 전 조회 2,506
🐛 버그신고