조건절 질문해용 정보
조건절 질문해용
본문
$str = "{$stx}";
$urldecode = urldecode($str);
$urlencode = urlencode($str);
$urldecode = urldecode($str);
$urlencode = urlencode($str);
$sql1 = " select ws_name, ws_memo from $g4[website_table] where ws_memo LIKE '%$stx%' ";
$ws1 = sql_fetch($sql1);
if ($ws1[ws_memo] == $urldecode) { //요부분
echo $ws_name;
}
이럴 경우~ if 문에서 제어를 하려면...
우짜나용??
LIKE '%$stx%' 요렇게 하니까 대략 난감...
댓글 전체
이놈을 사용해보세요.
> strcasecmp
> (PHP 3>= 3.0.2, PHP 4 , PHP 5)
> strcasecmp -- 대소문자를 구별하지 않는 바이너리 호환 문자열 비교
http://kr2.php.net/manual/kr/function.strcasecmp.php
> strcasecmp
> (PHP 3>= 3.0.2, PHP 4 , PHP 5)
> strcasecmp -- 대소문자를 구별하지 않는 바이너리 호환 문자열 비교
http://kr2.php.net/manual/kr/function.strcasecmp.php
잘 모르겠네요. ^ ^;;
ㅋㅋ
위의 strcasecmp는 두개를 비교하는것이군요. 죄송합니다.
위의 strcasecmp는 두개를 비교하는것이군요. 죄송합니다.
> where ws_memo LIKE '%$stx%'
ws_memo 필드에서 $stx 를 포함하는 내용을 조회하신후 if 문으로 다시한번 확인하시는것은 무었 때문인가요?
위처럼 한다면 모두 if문 안쪽으로 들어갈텐데...
의도하시는바를 모르겠습니다. ???
혹시 검색된것이 있을때와 없을때의 처리문제라면 다음처럼...
if ($ws1[ws_name]) {
echo $ws1[ws_name];
}
ws_memo 필드에서 $stx 를 포함하는 내용을 조회하신후 if 문으로 다시한번 확인하시는것은 무었 때문인가요?
위처럼 한다면 모두 if문 안쪽으로 들어갈텐데...
의도하시는바를 모르겠습니다. ???
혹시 검색된것이 있을때와 없을때의 처리문제라면 다음처럼...
if ($ws1[ws_name]) {
echo $ws1[ws_name];
}
검색결과가 없을 경우 바로가기를 감추려고 했습니다. ㅡ.ㅡ;;;
<?
$str = "{$stx}";
$urldecode = urldecode($str);
$urlencode = urlencode($str);
$sqlchkthis = " select ws_name, ws_memo from $g4[website_table] where ws_memo = '$stx' ";
$chkthis = sql_fetch($sqlchkthis);
if ($chkthis[ws_memo] == $urldecode) { // 검색 결과가 없을 경우 아래 바로가기를 나타내지 말아야 하는데~ 어떻게 짜야 할까~
?>
<b>바로가기</b><p>
<?
$sqlthis = " select ws_name, ws_memo from $g4[website_table] where ws_memo LIKE '%$stx%' ";
$resultthis = sql_query($sqlthis);
for ($i=0; $rowthis = sql_fetch_array($resultthis); $i++) {
echo $ws_name;
}
} //닫기
?>
<?
$str = "{$stx}";
$urldecode = urldecode($str);
$urlencode = urlencode($str);
$sqlchkthis = " select ws_name, ws_memo from $g4[website_table] where ws_memo = '$stx' ";
$chkthis = sql_fetch($sqlchkthis);
if ($chkthis[ws_memo] == $urldecode) { // 검색 결과가 없을 경우 아래 바로가기를 나타내지 말아야 하는데~ 어떻게 짜야 할까~
?>
<b>바로가기</b><p>
<?
$sqlthis = " select ws_name, ws_memo from $g4[website_table] where ws_memo LIKE '%$stx%' ";
$resultthis = sql_query($sqlthis);
for ($i=0; $rowthis = sql_fetch_array($resultthis); $i++) {
echo $ws_name;
}
} //닫기
?>
if (stristr( $ws1[ws_memo], $urldecode)) { //요부분
echo $ws_name;
}
$ws1['ws_memo']안에 $urldecode 문자열이 포함 되어 있는지 검사함
echo $ws_name;
}
$ws1['ws_memo']안에 $urldecode 문자열이 포함 되어 있는지 검사함
너무너무 잘 됩니다! ^ ^
항상 친절한 답변 감사합니다!!! ㅎ
항상 친절한 답변 감사합니다!!! ㅎ