I'm using a database to populate a jQuery autocomplete textbox. I am also pulling the value of the image link from the database. The image displays fine in the dropdown menu, but when selected it displays the image code, which obviously, I'd like to hide. Below is a sample of what appears in the textbox after a selection has been made and also the query code. Any help is much appreciated!
<img src="images/catalog-images/1211767440.png" width="100" >Apple iPhone 4S - 16GB
<?php
$q=$_GET['q'];
$my_data = str_replace(array("'", '"'), array("", ""), $q);
//$my_data=mysql_real_escape_string($q);
$mysqli=mysqli_connect($DB_host,$DB_user,$DB_pass,$DB_name) or die("Database Error");
$sql="SELECT * FROM cell_brands WHERE name LIKE '%$my_data%' OR keyword1 LIKE '%$my_data%' OR keyword2 LIKE '%$my_data%'";
$result = mysqli_query($mysqli,$sql) or die(mysqli_error());
if($result)
{
while($row=mysqli_fetch_array($result))
{
// echo "<img src=\"images/catalog-images/" . $row["photo-image"] . "\" width=\"100\" >";
echo $row["photo-image"];
echo $row['name']."\n";
}
}
mysqli_close($mysqli);
?>