曹え 5811 发布于:2020-01-13 18:09:44
if($word){ $w.=" and ("; $str = explode(' ',$word); foreach($str as $s){ if($s)$w.=" title like '%".$s."%' or keywords like '%".$s."%' or"; } $w = rtrim($w,'or').") "; $sql_c = "SELECT * FROM dy_search WHERE searchword = '".$word."'"; $res = syDB('classtype')->findSql($sql_c); if(!$res){ $sql_c = "INSERT INTO dy_search (searchword,hits) VALUES ('$word',1)"; $res1 = syDB('classtype')->findSql($sql_c); } else{ $sql_c = "UPDATE dy_search SET hits=hits+1 WHERE searchword='$word'"; $res2 = syDB('classtype')->findSql($sql_c); } }
登录后可以留言提问!
微信扫码登录