私たちの検索候補に問題があります。ウェブサイトで提案をクリックするたびに、検索クエリの前にスペースが表示され、クエリが失敗します。検索ボックスの候補を検索クエリの前に入力してください
我々が提案を使用したコードはこれです:
$query = $db->query("SELECT DISTINCT productnaam FROM product WHERE merk LIKE '$queryString%' LIMIT 10");
if($query) {
// While there are results loop through them - fetching an Object (i like PHP5 btw!).
while ($result = $query ->fetch_object()) {
// Format the results, im using <li> for the list, you can change it.
// The onClick function fills the textbox with the result.
// YOU MUST CHANGE: $result->value to $result->your_colum
echo '<li onClick="fill(\''.$result->merk.' '.$result->productnaam.'\');">'
.$result->merk.' '.$result->productnaam.''.'</li>';
}
} else {
echo 'ERROR: There was a problem with the query.';
'$ queryString'はどこから来たのですか? (コードを表示) – greut