c

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

· 2006-12-24 (일) 19:39:09 · 2172 · 3
 
위 지니아빠 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>
 
 

조언 부탁드립니다^^
|

댓글 3개

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' ";
}
}
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
06-12-26 조회 1,630
06-12-26 조회 1,758
06-12-25 조회 2,342
06-12-25 조회 1,694
06-12-25 조회 5,771
06-12-25 조회 1,641
06-12-25 조회 1,596
06-12-25 조회 2,300
06-12-25 조회 1,771
06-12-25 조회 1,609
06-12-25 조회 1,875
06-12-25 조회 1,694
06-12-25 조회 1,679
06-12-24 조회 1,671
06-12-24 조회 1,625
06-12-24 조회 1,707
06-12-24 조회 2,140
06-12-24 조회 2,173
06-12-24 조회 1,624
06-12-24 조회 1,775