我有一个搜索引擎,但问题是搜索引擎不显示搜索结果,与数据库的连接是正确的,代码如下:
PHP:
if (isset($_POST['search'])) {
$searchq = $_POST['search'];
$searchq = preg_replace("#[^0-9a-z]#i", "", $searchq);
$query = mysql_query("SELECT * FROM tReference WHERE sReference LIKE '%$searchq%' OR sSearch LIKE '%$searchq%' OR sSort LIKE '%$searchq%'") or die("La Recherche est impossible");
$count = mysql_num_rows($query);
if ($count == 0) {
$output = "Aucun Résultat Pour Cette Recherche!";
//English Trans : No results have been Found!
}
else
{
$sReference = $count['sReference'];
$output.= '<div><ul><li><a target="_blanc" href="refrences.php?reference=' . $sReference . '" title="' . $sReference . '">' . $sReference . '</a></li></ul></div>';
}
}
HTML:
<div id="searchd">
<div class="searchc">
<form action="reference.php" method="post">
<input type="text" name="search" palceholder="Recherhcer...">
<input type="submit" Value="Ok">
<div class="clear"></div>
</form>
</div>
<div id="output">
<?php echo ($output); ?>
</div>
</div>
并提前感谢所有人!