Ok i have this code
<?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';
}
?>
and i got this error "Notice: Undefined index: id in C:\xampp\htdocs\madeinusa\search.php on line 20" and this is the line 20: "$ff .= "View full";" and i dont know what seems the problem is. i think there is actually problem with the query or in displaying the records scheme. hope someone could help, im open on any suggestions and recommendations. thanks in advance.
var_exportthe contents of$rowsomewhere - a log file, or if all else fails, the browser. In this case, the associative array$rowdoes not contain an element at key'id', which is exactly what the error message is telling you.