select선택한 값을 php 쿼리문에 넣으려는데 어떻게하면 되나요??
본문
<form name="fregisterform" action="javascript:doChangeSelect('3')" method="get" autocomplete="off">
<div style="display: flex; justify-content: center;" id="control">
<div class="col-md-2 col-xs-3">
<select id="srchArea1" name="area1">
<option value="" selected>시도</option>
</select>
</div>
<div class="col-md-2 col-xs-3">
<select id="srchArea2" name="area2">
<option value="" selected>군구</option>
</select>
</div>
<div class="col-md-1 col-xs-3">
<input class="main_bg" type="submit" value="검색">
</div>
</div>
</form>
여기서 선택한 값을 아래 쿼리문에 있는 $area1, $area2 위치에 넣어서 사용하려고합니다
<?php
$sql .= " and mb_id in ( select mb_id from {$g5['member_area_table']} where 1=1 and ( ( mb_area1 = '$area1' and ifnull(mb_area2,'') = '' ) or ( mb_area1 = '$area1' and mb_area2 = '$area2'))) ";
?>
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
아래는 자바스크립 코드입니다
function doChangeSelect(gubun) {
if (gubun == "3") {
$("#selectGubun1").removeClass("on");
$("#selectGubun2").removeClass("on");
$("#selectGubun3").removeClass("on");
$("#selectGubun3").addClass("on");
$("#proposeList").hide();
$("#detailTitle").hide();
$("#subDetail").hide();
$("#subList").hide();
$("#partnerNote").hide();
$("#divRreview").hide();
$("#selectList").hide();
$("#searchList").show();
}
}