需要幫助以在下面的代碼中將圖像與標題和描述一起回顯,當搜索時顯示我在數據庫中插入的標題和描述,我想要與標題和描述時,在搜索欄中顯示圖像連同標題和描述一起作爲數據庫使用搜索欄的結果
<?php
$query = $_GET['query'];
$min_length = 1;
if(strlen($query) >= $min_length){
$query = htmlspecialchars($query);
$query = mysql_real_escape_string($query);
$raw_results = mysql_query("SELECT * FROM products
WHERE (`title` LIKE '%".$query."%') OR (`description` LIKE '%".$query."%')") or die(mysql_error());
if(mysql_num_rows($raw_results) > 0){
while($results = mysql_fetch_array($raw_results)){
echo "<p><h3>".$results['title']."</h3>".$results['description']."</p>";
}
}
else{
echo "No results";
}
}
else{
echo "Minimum length is ".$min_length;
}
?>
我使用的XAMPP數據庫 –