php sql 쿼리 문법 질문! > 그누4 질문답변

그누4 질문답변

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

php sql 쿼리 문법 질문! 정보

php sql 쿼리 문법 질문!

본문

select distinct wr_parent from g4_write_kira where ((INSTR(wr_3, '1')) ) and (wr_num between '-3' and '9997') and wr_4 not in ''


 


다음과 같이 쓰고 싶은데... 어떻게 고쳐야 할까요?
  • 복사

댓글 전체

게시판 검색에서 특정 필드에 값이 없는것을 제외 출력하게 하려고

 if($no){
    $sql_search2 = " and ".$no." not in ''";
      }

    // 원글만 얻는다. (코멘트의 내용도 검색하기 위함)
    $sql = " select distinct wr_parent from $write_table where $sql_search $sql_search2 ";

이렇게 bbs/list.php를 수정 추가하고.
게시판 검색 주소에
&sfl=wr_3&stx=1&no=wr_4
이런식으로 줬거든요.
그랬더니..
select distinct wr_parent from g4_write_kira where ((INSTR(wr_3, '1')) ) and (wr_num between '-3' and '9997') and wr_4 not in ''

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 '''' at line 1

error file : /kira/bbs/board.php

이런에러가 떠서 ^^;;
© SIRSOFT
현재 페이지 제일 처음으로