到目前爲止,我有這個...庫MySQLi/PHP搜索引擎不工作
<html>
<head>
<title>Search</title>
</head>
<body>
<form method="GET">
<input type="text" size="30" />
</form>
<?php
$db = "example";
mysqli_connect("localhost","root","*************");
mysqli_select_db($db);
$query = mysqli_query("SELECT * FROM TABLE WHERE search_query = '$q'");
mysqli_query($query);
$results = mysqli_fetch_array($query);
if($results !=="") {
echo "<a href='$array[0]'>Result 1</a>";
echo "<a href='$array[1]'>Result 2</a>";
// you get the idea
}
?>
</body>
</html>
我很奇怪,爲什麼庫MySQLi沒有返回我搜查了吧。我插入數據到手動數據庫...它只是不工作
謝謝你,我還加了「的mysql_query($查詢);」使其實際**執行**代碼 – user2316286 2013-04-24 16:01:29