This site has me all paranoid about SQL injection as far as I can notice this search has prepared statements and is MSQLI but could still be injectable
thanks
<?php
$searchTerm = trim($_GET['keyname']);
if($searchTerm == "")
{
echo "Enter name you are searching for.";
exit();
}
$host = "localhost";
$db = "DB";
$user = "user";
$pwd = "pass";
$link = mysqli_connect($host, $user, $pwd, $db);
$query = "SELECT * FROM TABLE WHERE Name LIKE '%$searchTerm%'";
$results = mysqli_query($link, $query);
if(mysqli_num_rows($results) >= 1)
{
$output = "";
while($row = mysqli_fetch_array($results))
{
echo "<td align='center' width='60'>" . "<a href=\"{$row['page']}\"><img src=\"{$row['img']}\">" ."</td>";
}
echo $output;
}
else
echo "There was no matching record for the name " . $searchTerm;
?>