我正在构建 php 搜索框,这是我的查询
SELECT * FROM table1, table2 WHERE table1.title AND table2.posts LIKE '$query%' LIMIT 10
查询后的代码是
if($query) {
while ($result = $query ->fetch_object()) {
echo '<li onClick="window.open(\''.$result->guid.'\');">'.$result->post_title.'</li><br>';
}
} else {
echo 'ERROR: There was a problem with the query.';
}
它不获取任何东西。我认为这是来自查询的内容。请帮忙..