새글 검색에 name 항목을 검색되게하려면 어떻게하나요?
본문
new.skin.php 에서
<form name="fnew" method="get">
<?php echo $group_select ?>
<label for="view" class="sound_only">검색대상</label>
<select name="view" id="view">
<option value="">전체게시물
<option value="w">원글만
<option value="c">코멘트만
</select>
<label for="wr_subject" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="wr_name" value="<?php echo $wr_name ?>" id="wr_name" required class="frm_input" size="40">
<button type="submit" class="btn_submit"><i class="fa fa-search" aria-hidden="true"></i> 검색</button>
<p>업체이름만 검색가능</p>
</form>
bbs/new.php 에서는 무엇을 추가해야하나요?
답변 1
if ($mb_id) {
$sql_common .= " and a.mb_id = '{$mb_id}' ";
}
이 부분을 수정해야 합니다.
if ($wr_name) {
$sql_common .= " and b.wr_name= '{$wr_name}' ";
}