$title=$navinfor['ftitle']?$navinfor['ftitle']:$navinfor['title']; $id=$navinfor[id] ; $conte=$navinfor[newstext]; $words = ChineseWordSegment($title); $sqlstr = '('; foreach($words as $k=>$w){ $im = 1 + showtimes($w,strip_tags($conte)); $sqlstr .= ($k?'+':'')."(`title` like '%".$w."%')*$im"; } $sqlstr .= ")"; $mysql = "select * ,$sqlstr as mylike from {$dbtbpre}ecms_news where id<>$id and $sqlstr order by mylike desc limit 6"; $sql=$empire->query($mysql); while($bqr=$empire->fetch($sql)){ ?>