미채택 완료

get_sql_search 로 검색할 때, 서울로 검색해도 호출이되고, 대전으로 검색해도 호출이 되게 하려면,

2014-05-30 (금) 10:03:54 5,953

안녕하세요. :)

여분필드 wr_20 의 값이 '서울,대전' 인데요.

get_sql_search 로 검색할 때, 서울로 검색해도 호출이되고, 대전으로 검색해도 호출이 되게 하려면,

어떻게해야 되나요?

|

답변 2개 / 댓글 1개

2014-05-30 (금) 13:15:14
if($stx_wr_10) $sql = "AND wr_10 like '%$stx_wr_10%' ";
2014-05-30 (금) 10:45:38
get_sql_search 함수에서 수정하실 필요는 없고요.

list.skin.php 에서


    <form name="fsearch" method="get">
    <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
    <input type="hidden" name="sca" value="<?php echo $sca ?>">
    <input type="hidden" name="sop" value="and">
    <label for="sfl" class="sound_only">검색대상</label>
    <select name="sfl" id="sfl">
        <option value="wr_subject"<?php echo get_selected($sfl, 'wr_subject', true); ?>>제목</option>
        <option value="wr_content"<?php echo get_selected($sfl, 'wr_content'); ?>>내용</option>
        <option value="wr_subject||wr_content"<?php echo get_selected($sfl, 'wr_subject||wr_content'); ?>>제목+내용</option>
        <option value="mb_id,1"<?php echo get_selected($sfl, 'mb_id,1'); ?>>회원아이디</option>
        <option value="mb_id,0"<?php echo get_selected($sfl, 'mb_id,0'); ?>>회원아이디(코)</option>
        <option value="wr_name,1"<?php echo get_selected($sfl, 'wr_name,1'); ?>>글쓴이</option>
        <option value="wr_name,0"<?php echo get_selected($sfl, 'wr_name,0'); ?>>글쓴이(코)</option>
        <option value="wr_10"<?php echo get_selected($sfl, 'wr_10', true); ?>>지역</option>
    </select>
    <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
    <input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx" class="frm_input required" size="15" maxlength="15">
    <input type="submit" value="검색" class="btn_submit">
    </form>


select 부분에 추가해주시면 됩니다.

답변에 대한 댓글 1개

잉끼님 답변 감사드려요. :)
get_sql_search 를 멀티검색때문에 변경을 하여서, 말씀하신데로 사용 할 수가 없어서요.
다른 방법은 없을까요?

function get_sql_search($search_ca_name, $stx_wr_1, $stx_wr_2, $stx_wr_3, $stx_wr_4, $stx_wr_5, $stx_wr_6, $stx_wr_7, $stx_wr_8, $stx_wr_9, $stx_wr_10, $search_field, $search_text, $search_operator='and')

답변을 작성하려면 로그인이 필요합니다.