<?php
ini_set('display_errors', 0);
$search = $_GET ['search'];
mysql_connect("localhost", "root", "gokul");
mysql_select_db("search123");
$query = mysql_query("SELECT * FROM search WHERE name LIKE '%" . $queryString . "%'");
$foundnum = mysql_num_rows($query);
if ($foundnum == 0) {
echo "Sorry, there are no matching result for <b>$search</b>.</br></br>1.
Try more general words. for example: If you want to search 'how to create a website'
then use general keyword like 'create' 'website'</br>2. Try different words with similar
meaning</br>3. Please check your spelling<br/>4.PLEASE DON'T USE SPACES";
}
else {
echo "$foundnum results found !<p>";
$row = mysql_fetch_assoc($query);
{
$title = $runrows ['title'];
$desc = $runrows ['description'];
$url = $runrows ['url'];
echo "<a href=$row[url]>$row[name]</a><br><font color=green>$row[url]</font><br>$row[desc]<br/>";
}
}
?>
これは私の検索エンジンスクリプトです。このスクリプトは1つの結果しか表示しません。どのようにPHPにPHP検索エンジンスクリプト
結果を印刷するにはループを追加する必要があります。すなわち「while」 – Elen