UTF-8 다중카테고리 검색에러 SQL syntax near 'and (wr_num between '-2' and '9998') ' at line 1 > 그누4 질문답변

그누4 질문답변

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

UTF-8 다중카테고리 검색에러 SQL syntax near 'and (wr_num between '-2' and '9998') ' at line 1 정보

UTF-8 다중카테고리 검색에러 SQL syntax near 'and (wr_num between '-2' and '9998') ' at line 1

본문

 
지니아빠 3중 카테고리 스킨 list에서
wr_9 필드 검색을 먼저하면 이런에러가 있는데 무슨 문제일까요 ?

카테고리 또는 10번필드 검색 후 9번필드 검색할 때는 잘됩니다.
 
 
select distinct wr_parent from g4_write_realsearch where and (wr_num between '-2' and '9998')
1064 : You have an error in your SQL syntax near 'and (wr_num between '-2' and '9998') ' at line 1
error file : /kr/bbs/board.php

 
 
리스트 카테고리 부분 소스는 아래와 같이했구요

    지역 : <select name=sca onchange="location='<?=$category_location?>&sca='+encodeURI(this.value)+'&wr_10='+encodeURI(this.form.wr_10.value)+'&wr_9='+encodeURI(this.form.wr_9.value);"><option value=''>지역선택</option><?=$category_option?></select>

  직종 : <select name=wr_9 onchange="location='<?=$category_location?>&sca='+encodeURI(this.form.sca.value)+'&wr_10='+encodeURI(this.form.wr_10.value)+'&wr_9='+encodeURI(this.value);"><option value=''>직종선택</option><?=$bo_9_option?></select>

  분야 : <select name=wr_10 onchange="location='<?=$category_location?>&sca='+encodeURI(this.form.sca.value)+'&wr_9='+encodeURI(this.form.wr_9.value)+'&wr_10='+encodeURI(this.value);"><option value=''>근무분야</option><?=$bo_10_option?></select>
 
 

조언 부탁드립니다^^
  • 복사

댓글 전체

where and...

중간에 첫째 검색 조건이 빠져서 sql 문법 에러가 납니다.

순서상 wr_9 앞에 있는 조건을 넣지 않으면 안 되도록 프로그램 했나 봅니다.
<select name=wr_9 onchange="location='<?=$category_location?>&sca='+encodeURI(this.form.sca.value)+'&wr_10='+encodeURI(this.form.wr_10.value)+'&wr_9='+encodeURI(this.value);"><option value=''>직종선택</option><?=$bo_9_option?></select>

이부분 wr_9 셀렉트 소스에는 다른 두개 필드도도 포함된걸로 보이는데요
원제공스킨을 유니코드로 바꾸면서 생기는 문제인지  이런 현상보신분 코멘트 부탁드립니다.
rolo (61.♡.156.86) 님 말씀처럼 아래 에서 9번 부분에 오타가있었군요
검색잘되는군요 유니코드에서도 ㅎㅎ
http://www.chinakorean114.com/kr/bbs/board.php?bo_table=realsearch

1. 설치폴더/lib/common.lib.php 486 라인

    global $g4, $wr_10, $wr_9;

    $str = "";
    if ($search_ca_name) {
        $str = " ca_name = '$search_ca_name' ";
      }

if ($wr_10) {
if ($str) {
$str = "(" . $str . " and wr_10 = '$wr_10') ";
} else {
$str = " wr_10 = '$wr_10' ";
}
    }

if ($wr_9) {
if ($str) {
$str = "(" . $str . " and wr_9 = '$wr_9') ";
} else {
$str = " wr_9 = '$wr_9' ";
}
    }
© SIRSOFT
현재 페이지 제일 처음으로