게시판 검색 하면 글 제목 깨어져서 검색 에러 납니다
본문
안녕하세요
select distinct wr_parent from g4_write_test where ((INSTR(LOWER(wr_subject), LOWER('test'))) ) and (wr_num between '-8' and '9992')
+-----------+
| wr_parent |
+-----------+
| 0 |
+-----------+
1 row in set (0.00 sec)
select distinct wr_parent from g4_write_test where ((INSTR(wr_subject, '테스트')) ) and (wr_num between '-5' and '9995') order by wr_num, wr_reply limit 0, 10
검색 에러가 납니다. 어떻게 해야 할까요?
/bbs/list.php 수정한 것도 없는데 왜 이럴까요?
--> 테스트 결과 영문만 되고 한글이 안맞는것 같습니다. 흠...
문제를 정리해 보자면
1. 제목 한글 검색 안됨 (영문 됨)
2. 영문 아이디 검색시 일부 표시 문제
그래서 list.php에서 sql 문장 echo 봤습니다
select distinct wr_parent from g4_write_test where ((INSTR(wr_subject, '테스트')) ) and (wr_num between '-5' and '9995')
select distinct wr_parent from g4_write_test where ((INSTR(wr_subject, '테스트')) )
and (wr_num between '-8' and '9992')
select distinct wr_parent from g4_write_test where ((INSTR(LOWER(wr_subject), LOWER('test'))) ) and (wr_num between '-8' and '9992')
한글만 문제네요...
+-----------+
| wr_parent |
+-----------+
| 0 |
+-----------+
1 row in set (0.00 sec)
select distinct wr_parent from g4_write_test where ((INSTR(wr_subject, '테스트')) ) and (wr_num between '-5' and '9995') order by wr_num, wr_reply limit 0, 10
이렇게 나옵니다.
mysql> select distinct wr_parent from g4_write_test where (( mb_id = 'test' ) ) and wr_is_comment = '0' and (wr_num between '-6' and '9994');
+-----------+
| wr_parent |
+-----------+
| 0 |
| 6 |
+-----------+
2 rows in set (0.00 sec)
+-----------+
| wr_parent |
+-----------+
| 0 |
| 6 |
+-----------+
2 rows in set (0.00 sec)
mysql>
검색 하면 위와 같이 에러가 납니다.
그래서 원래 있던 게시판 원본 스킨으로 해 봐도 에러가 납니다.
답변 1
자답합니다~
데이터베이스를 보니
wr_parent 값에 문제가 있었습니다.
잘 나가다가 0 으로 입력되어서 검색에 문제가 있었던 것이었습니다.
앞으로 DB 에러 부분의 대응이 필요할 것 같습니다.
답변을 작성하시기 전에 로그인 해주세요.