好的,我有这个代码
<?php
include_once ('database_connection.php');
if(isset($_GET['keyword'])){
$keyword = trim($_GET['keyword']) ;
$keyword = mysqli_real_escape_string($dbc, $keyword);
$query = "select name,title,description,link,type from items where name like '%$keyword%' or title like '%$keyword%' or description like '%$keyword%' or link like '%$keyword%' or type like '%$keyword%'";
//echo $query;
$result = mysqli_query($dbc,$query);
if($result){
if(mysqli_affected_rows($dbc)!=0){
$ff = "";
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){
$ff .= "<div id='itemdiv2' class='gradient'>";
$ff .= "<div id='imgc'>".'<img src="Images/media/'.$row['name'].'" />'."<br/>";
$ff .= "<a href='#?w=700' id='".$row['id']."' rel='popup' class='poplight'>View full<a/></div>";
$ff .= "<div id='pdiva'>"."<p id='ittitle'>".$row['title']."</p>";
$ff .= "<p id='itdes'>".$row['description']."</p>";
$ff .= "<a href='".$row['link']."'>".$row['link']."</a>";
$ff .= "</div>"."</div>";
echo $ff;
}
}else {
echo 'No Results for :"'.$_GET['keyword'].'"';
}
}
}else {
echo 'Parameter Missing';
}
?>
我收到此错误“注意:未定义的索引:第 20 行 C:\xampp\htdocs\madeinusa\search.php 中的 id”,这是第 20 行:“$ff .=”查看完整“;” 而且我不知道问题出在哪里。我认为查询或显示记录方案实际上存在问题。希望有人可以提供帮助,我对任何建议和建议持开放态度。提前致谢。