検索結果を次のようなものにするにはどうすればよいでしょうか: http://i.stack.imgur.com/NfPGs.png
結果は、特定の用語がセル内のどこにあるかを示します。
私は現在、この基本的な検索スクリプトを持っています:
$terms = explode("-", $SQuery);
$QuerySQL = "SELECT * FROM pages WHERE ";
foreach ($terms as $each){
$i++;
if ($i == 1)
$QuerySQL .= "Title LIKE '%$each%' OR Content LIKE '%$each%' OR Description LIKE '%$each%'";
else
$QuerySQL .= "OR Title LIKE '%$each%' OR Description LIKE '%$each%' OR Content LIKE '%$each%'";
}
$QueryNEW = mysql_query($QuerySQL);
WHILE($datarows_cat = mysql_fetch_array($QueryNEW)):
$title = $datarows_cat['Title'];
$Deleted = $datarows_cat['Deleted'];
$id = $datarows_cat['ID'];
if ($Deleted != "YES") {
echo "<a href='/{$id}'>{$title}</a><br/>";
}