지구인님께서 알려주신 회원검색팁에대한 질문입니다. > 그누4 질문답변

그누4 질문답변

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

지구인님께서 알려주신 회원검색팁에대한 질문입니다. 정보

지구인님께서 알려주신 회원검색팁에대한 질문입니다.

본문

지구인님게서 알려주신 팁자료실의
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=12396&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%ED%9A%8C%EC%9B%90%EA%B2%80%EC%83%89

궁금한게 있어서요^^

첫화면에 회원목록이 전부 나오는데 검색한 회원만 나오게 할수는 없는건지요.

그리고 아이디대신 닉네임을 검색할수있는 방법이 있으면 부디 도움좀 부탁드립니다.

좋은밤 되세요^^
  • 복사

댓글 전체

if ($Usex) { $sql_search .= " and (mb_sex = '$Usex') "; }
if ($UageF) { $sql_search .= " and (mb_birth <= '$UageF') "; }
if ($UageT) { $sql_search .= " and (mb_birth >= '$UageT') "; }
//if ($Uid) { $sql_search .= " and (mb_id = '$Uid') "; }
if ($Uid) { $sql_search .= " and (mb_id like '%$Uid%') "; }
if ($UregF) { $sql_search .= " and (mb_datetime >= '$UregF') "; }
if ($UregT) { $sql_search .= " and (mb_datetime <= '$UregT') "; }

부분을

$temp_sql_search = "";
if ($Usex) { $temp_sql_search .= " and (mb_sex = '$Usex') "; }
if ($UageF) { $temp_sql_search .= " and (mb_birth <= '$UageF') "; }
if ($UageT) { $temp_sql_search .= " and (mb_birth >= '$UageT') "; }
if ($Uid) { $temp_sql_search .= " and (mb_nick = '$Uid') "; }
if ($Uid) { $temp_sql_search .= " and (mb_nick like '%$Uid%') "; }
if ($UregF) { $temp_sql_search .= " and (mb_datetime >= '$UregF') "; }
if ($UregT) { $temp_sql_search .= " and (mb_datetime <= '$UregT') "; }

if($temp_sql_search){
$sql_search .= $temp_sql_search;
}
else{
$sql_search .= " and mb_id = '' "; 
}
됩니다

검색제목에 아이디는 닉네임으로 변경해 주시고요
회원 목록에 전부 나오지 않고 검색된 회원만 나오게 하려면 검색 구분에 넘어오는 값을 체크 될때만
쿼리를 날려 주면 되겠죠 쿼리 자체가 어떻게 되어 있는지 모르니 그리고 id값을 닉네임 값으로 변경하시면 가능 합니다. 기본적으로 디비 쿼리를 알아야 가능 하죠 ;;
© SIRSOFT
현재 페이지 제일 처음으로