sql 조건 검색문 채택완료
아래처럼 되면.. 목록에 출력값이 없어야 정상인데 g5_write_recruits 테이블에 값들이
다 나오고 있는데요..
현재 맞춤정보가 담겨있는 테이블 my_information 에 type1 ~ type13 컬럼들에 모든 값이 비어 있어서 g5_write_recruits 에 조건이 맞는게 하나도 없는데 테스트로 등록된 목록이 출력이 되고 있네요... 어디가 잘못된걸까요?
검색을 하는건 아니고 자체에서 검색이 되고 뿌려주고 있는데 현재는 출력이 되면 안되거든요
my_information 테이블에 type1 컬럼에 값이 들어가면 해당하는것만 출력은 잘되요.
근데 값이 다 비어 있으면 목록이 아에 나오지 않아야 하는데 말이죠 ..
$sql_common = " from g5_write_recruits ";
/* 맞춤정보 조건문 */ $sql = " select * from my_information where mb_id = '{$member['mb_id']}' "; $sch = sql_fetch($sql);
$sql_search = " where type1 like '%{$sch['type1']}%' and type2 like '%{$sch['type2']}%' and type3 like '%{$sch['type3']}%' and type4 like '%{$sch['type4']}%' and type5 like '%{$sch['type5']}%' and type6 like '%{$sch['type6']}%' and type7 like '%{$sch['type7']}%' and type8 like '%{$sch['type8']}%' and type9 like '%{$sch['type9']}%' and type10 like '%{$sch['type10']}%' and type11 like '%{$sch['type11']}%' and type12 like '%{$sch['type12']}%' and type13 like '%{$sch['type13']}%' ";
$sql = " select * {$sql_common} {$sql_search} "; $result = sql_query($sql);
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인