php 다 중 키워드 하 이 라이트 디 스 플레이 구현 코드
                                            
 3411 단어  키워드하 이 라이트 디 스 플레이
                    
 
 검색 시작: 여기 키워드 검색("대","이")
 
 검색 결과: 하 이 라이트 디 스 플레이
 
 프로젝트 에 필요 한 데이터베이스 구조:
구현 코드:conn.php
 
<?php 
$conn = @ mysql_connect("localhost", "root", "") or die("       "); 
mysql_select_db("form", $conn); 
mysql_query("set names 'gbk'"); 
?> 
 
<?php 
include 'conn.php'; 
?> 
<table width=500 align="center"> 
<form action="" method="get"> 
<tr> 
<td>   :<input type="text" name="keyWord" /> 
<input type="submit" value="  " /></td> 
</tr> 
</form> 
</table> 
<table width=500 border="0" align="center" cellpadding="5" 
cellspacing="1" bgcolor="#add3ef"> 
<?php 
//                 
if($_GET['keyWord']){ 
//            
$key=explode(' ', $_GET[keyWord]); 
$sql="select * from message where title like '$key[0]' or title like '$key[1]' or content like '$key[0]' or content like '%$key[1]%'"; 
$query=mysql_query($sql); 
while ($row=mysql_fetch_array($query)){ 
//     ,           
$row[title]=preg_replace("/$key[0]/i", "<font color=red><b>$key[0]</b></font>", $row[title]); 
$row[title]=preg_replace("/$key[0]/i", "<font color=red><b>$key[1]</b></font>", $row[title]); 
$row[content]=preg_replace("/$key[0]/i", "<font color=red><b>$key[0]</b></font>", $row[content]); 
$row[content]=preg_replace("/$key[1]/i", "<font color=red><b>$key[1]</b></font>", $row[content]); 
?> 
<tr bgcolor="#eff3ff"> 
<td>  :<font color="black"><?=$row[title]?></font>   :<font color="black"><?=$row[user] ?></font> 
<div align="right"><a href="preEdit.php?id=<?=$row[id]?>">  </a>  |  <a 
href="delete.php?id=<?=$row[id]?>">  </a></div> 
</td> 
</tr> 
<tr bgColor="#ffffff"> 
<td>  :<?=$row[content]?></td> 
</tr> 
<tr bgColor="#ffffff"> 
<td> 
<div align="right">    :<?=$row[lastdate]?></div> 
</td> 
</tr> 
<?php } 
} 
?> 
</table> 
 
//            
$key=explode(' ', $_GET[keyWord]); 
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
C++ Builder XE4, 10.2 Tokyo > TMutex, TCriticalSection: thread affinity | TSemaphore: not thread affinity | semaphore의 잠금 코드운영 환경 관련 링크 위의 링크에서는 록이 예상대로는 아니었다. 에서 질문을 했지만 Remy Lebeau에게 자세한 답변을 받았습니다. 답변 개요 (해석 실수가 있을지도 모릅니다) TMutex: thread affi...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.