검색 질문 좀 드릴게요.. 정보
검색 질문 좀 드릴게요..본문
초보가 검색 좀 달려니까 진짜 힘드네요..아래를 넣었는데요..
wr_2와 wr_8 이 검색이 되게 하려고 합니다...
이 두가지 충족한 결과가 나오게 하려고 합니다.이건 검색해서 소스를 얻었는데요..
아래를 list.skin.php에 넣어 봤더니 단추 누르니까 에러가 이렇게 뜨네요. (에러는 아래에..)
뭐가 잘못 된 건지 알수 있을까요.
===============================================
<!--여기부터 검색 테스트-->
<script language="javascript">
<!--//-- 스킨용 : 여유필드 다중셀렉트창
//-- 여유필드 중복셀렉트가 가능하게 해주는 함수
//-- 수정작업시, 아래 함수와 함께 write.skin.php에 사용된 '여유필드(wr_?)이름과 셀렉트문'을 가져와 붙이면 바로적용가능
//-- 단, 반드시 게시물리스트(list.skin.php)에 여유필드값이 게시물에 주어져야함.
//-- 중복필드가 필요없는 경우 'document.fsearch_area.srch_type.value'삭제, 셀렉트문삭제, value값에서 필드명삭제
function onChangeKey() {
var srch_type = document.fsearch_area.srch_type.value;
var srch_type2 = document.fsearch_area.srch_type2.value;
if (srch_type == "" && srch_type2 == "") {
alert("유형을 선택하세요!!");
return false;
} else {
if (srch_type2 == "전체") {
document.fsearch_area.stx.value = srch_type;
} else {
document.fsearch_area.stx.value = srch_type + " " + srch_type2;
}
document.fsearch_area.submit();
}
}
//-->
</script>
<table cellpadding=0 cellspacing=0 border=0>
<form name=fsearch_area method=get>
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<tr>
<td>+ 유형별 :
<input type=hidden name=sfl value="concat(wr_2,wr_8)">
<select name=srch_type>
<option selected value=''>문제유형</option>
<option value='새차'>새차</option>
<option value='중고차'>중고차</option>
</select>
<select name=srch_type2>
<option selected>출제년도</option>
<option value='급매'>급매</option>
<option value='협상'>협상</option>
</select>
<input type=image src="<?=$board_skin_path?>/img/icon_search.gif" border=0 align=absmiddle onClick="onChangeKey();return false;" >
<input type=hidden name=sop value='and'>
<input type=hidden name=stx value=''>
</td>
</tr>
</form>
</table>
<?
if ($srch_type != "") { $stx = ""; }
?>
=============에러=========================
select distinct wr_parent from g4_write_car where ((INSTR(concat(wr_2, '새차')) and (INSTR(concat(wr_2, '급매')) ) and wr_is_comment = '0' and (wr_num between '-5' and '9995')
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 ') and (INSTR(concat(wr_2, '급매')) ) and wr_is_comment = '0'
error file : /board/bbs/board.php
wr_2와 wr_8 이 검색이 되게 하려고 합니다...
이 두가지 충족한 결과가 나오게 하려고 합니다.이건 검색해서 소스를 얻었는데요..
아래를 list.skin.php에 넣어 봤더니 단추 누르니까 에러가 이렇게 뜨네요. (에러는 아래에..)
뭐가 잘못 된 건지 알수 있을까요.
===============================================
<!--여기부터 검색 테스트-->
<script language="javascript">
<!--//-- 스킨용 : 여유필드 다중셀렉트창
//-- 여유필드 중복셀렉트가 가능하게 해주는 함수
//-- 수정작업시, 아래 함수와 함께 write.skin.php에 사용된 '여유필드(wr_?)이름과 셀렉트문'을 가져와 붙이면 바로적용가능
//-- 단, 반드시 게시물리스트(list.skin.php)에 여유필드값이 게시물에 주어져야함.
//-- 중복필드가 필요없는 경우 'document.fsearch_area.srch_type.value'삭제, 셀렉트문삭제, value값에서 필드명삭제
function onChangeKey() {
var srch_type = document.fsearch_area.srch_type.value;
var srch_type2 = document.fsearch_area.srch_type2.value;
if (srch_type == "" && srch_type2 == "") {
alert("유형을 선택하세요!!");
return false;
} else {
if (srch_type2 == "전체") {
document.fsearch_area.stx.value = srch_type;
} else {
document.fsearch_area.stx.value = srch_type + " " + srch_type2;
}
document.fsearch_area.submit();
}
}
//-->
</script>
<table cellpadding=0 cellspacing=0 border=0>
<form name=fsearch_area method=get>
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<tr>
<td>+ 유형별 :
<input type=hidden name=sfl value="concat(wr_2,wr_8)">
<select name=srch_type>
<option selected value=''>문제유형</option>
<option value='새차'>새차</option>
<option value='중고차'>중고차</option>
</select>
<select name=srch_type2>
<option selected>출제년도</option>
<option value='급매'>급매</option>
<option value='협상'>협상</option>
</select>
<input type=image src="<?=$board_skin_path?>/img/icon_search.gif" border=0 align=absmiddle onClick="onChangeKey();return false;" >
<input type=hidden name=sop value='and'>
<input type=hidden name=stx value=''>
</td>
</tr>
</form>
</table>
<?
if ($srch_type != "") { $stx = ""; }
?>
=============에러=========================
select distinct wr_parent from g4_write_car where ((INSTR(concat(wr_2, '새차')) and (INSTR(concat(wr_2, '급매')) ) and wr_is_comment = '0' and (wr_num between '-5' and '9995')
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 ') and (INSTR(concat(wr_2, '급매')) ) and wr_is_comment = '0'
error file : /board/bbs/board.php
댓글 전체