// 원글만 구한다.
$sql = " select count(*) as cnt from $write_table
where wr_reply like '$reply%'
and wr_id <> '{$write['wr_id']}'
and wr_num = '{$write['wr_num']}'
and wr_is_comment = 0 ";
$row = sql_fetch($sql);
if ($row['cnt'] && !$is_admin)
alert('이 글과 관련된 답변글이 존재하므로 삭제 할 수 없습니다.\\n\\n우선 답변글부터 삭제하여 주십시오.');