테스트 사이트 - 개발 중인 베타 버전입니다

인기검색어 문의드려요 채택완료

티거서 9년 전 조회 6,849

 

 

한글자 단어 즉(배, 콩, 조, 껌)이런한글자는 안나오게 가능할까요 

한글자 이상만 출력하고싶습니다. 

 

아래는 인기검색어 사용하는 코드입니다.

고수님들 도움 부탁드립니다.

 

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

 

$date_gap_old = date("Y-m-d", strtotime($date_gap) - ($date_cnt * 86400));

 

$old = array();

$sql2 = " select pp_word, count(*) as cnt from $g4[popular_table]

 where pp_date between '$date_gap_old' and '$date_gap'

 group by pp_word

 order by cnt desc, pp_word

 limit 0, 100 ";

$qry2 = sql_query($sql2);

$count = mysql_num_rows($qry2);

for ($j=0; $row2=sql_fetch_array($qry2); $j++) {

    $old[$j] = $row2;

}

 

for ($i=0; $i<$pop_cnt; $i++) 

{

    for ($j=0; $j<$count; $j++) {

if ($old[$j][pp_word] == $list[$i][pp_word]) {

   break;

}

    }

 

    $list[$i][pp_word] = urldecode($list[$i][pp_word]);

    $list[$i][pp_rank] = $i + 1;

    if ($count == $j) {

$list[$i][old_pp_rank] = 0;

$list[$i][rank_gap] = 0;

    } else {

$list[$i][old_pp_rank] = $j + 1;

$list[$i][rank_gap] = $list[$i][old_pp_rank] - $list[$i][pp_rank];

    }

    if ($list[$i][rank_gap] > 0)

$list[$i][icon] = "up";

    else if ($list[$i][rank_gap] < 0)

$list[$i][icon] = "down";

    else if ($list[$i][old_pp_rank] == 0)

$list[$i][icon] = "new";

    else if ($list[$i][rank_gap] == 0)

$list[$i][icon] = "nogap";

}

 

?>

 

   

   

인기검색어

   

         

         

         

  1.          

    ">

             

             

                case "up"    : echo "Up".abs($list[$i][rank_gap]).""; break;

                case "down"  : echo "Down".abs($list[$i][rank_gap]).""; break;

                case "new"   : echo "New"; break;

                case "nogap" : echo "Nogap"; break; } ?>

         

  2.      

       

   

댓글을 작성하려면 로그인이 필요합니다.

답변 5개

채택된 답변
+20 포인트
9년 전
where length(pp_word) > 1

이렇게 하면 되지 않을까요.
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

9년 전

배워갑니다 ^^

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

9년 전
pp_word를 셀렉트히는 쿼리에 넣으세요.
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">$sql2 = " select pp_word, count(*) as cnt from $g4[popular_table]</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;"><span class="Apple-tab-span" style="white-space: pre;">	</span>  where <span style="color: rgb(80, 80, 80); font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">length(pp_word) > 1 and </span><span style="font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">pp_date between '$date_gap_old' and '$date_gap'</span></p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;"><span class="Apple-tab-span" style="white-space: pre;">	</span>  group by pp_word</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;"><span class="Apple-tab-span" style="white-space: pre;">	</span>  order by cnt desc, pp_word</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;"><span class="Apple-tab-span" style="white-space: pre;">	</span>  limit 0, 100 ";</p><p style="word-break: break-all; color: rgb(72, 72, 72); font-family: 돋움, Dotum, sans-serif; font-size: 14.004px; letter-spacing: -0.01px; line-height: 25.2072px;">

 

이게 안된다면 lib / popular.lib.php 에다가 sql 작성부분에 where 사이에 and 넣고 length(pp_word) > 1 해보세요..

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

9년 전

별이님 답변 감사합니다. 

 

where length(pp_word) > 1  이걸 어느부분에 넣아야하는건가요 ㅠㅠ 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인