到目前为止,我有这个...
<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 没有返回我在栏中搜索的内容。我手动将数据插入数据库......它只是不工作