1:1문의에 제목, 내용, 글쓴이, 회원아이디 선택후 검색이 가능하도록 수정 (북마크스님,210812)

This commit is contained in:
kagla
2021-08-13 02:02:21 +00:00
parent 8d7bdb331d
commit 0731b57c80
6 changed files with 41 additions and 9 deletions

View File

@ -58,15 +58,33 @@ if(is_file($skin_file)) {
$stx = trim($stx);
if($stx) {
if (preg_match("/[a-zA-Z]/", $stx))
$sql_search .= " and ( INSTR(LOWER(qa_subject), LOWER('$stx')) > 0 or INSTR(LOWER(qa_content), LOWER('$stx')) > 0 )";
else
$sql_search .= " and ( INSTR(qa_subject, '$stx') > 0 or INSTR(qa_content, '$stx') > 0 ) ";
$sfl = trim($sfl);
if ($sfl) {
switch ($sfl) {
case "qa_subject" :
case "qa_content" :
case "qa_name" :
case "mb_id" :
break;
default :
$sfl = "qa_subject";
}
} else {
$sfl = "qa_subject";
}
$sql_search .= " and (`{$sfl}` like '%{$stx}%') ";
}
// $stx = trim($stx);
// if($stx) {
// if (preg_match("/[a-zA-Z]/", $stx))
// $sql_search .= " and ( INSTR(LOWER(qa_subject), LOWER('$stx')) > 0 or INSTR(LOWER(qa_content), LOWER('$stx')) > 0 )";
// else
// $sql_search .= " and ( INSTR(qa_subject, '$stx') > 0 or INSTR(qa_content, '$stx') > 0 ) ";
// }
$sql_order = " order by qa_num ";
$sql = " select count(*) as cnt
$sql = " select count(*) as cnt
$sql_common
$sql_search ";
$row = sql_fetch($sql);