Hi
I am trying to write a code that searches for a keyword in image database, and prints the images when the image matching the keyword is found..
I am able to implement the basic search function. However, there are 2 things I am not being able to do:
1) my code prints out the image path. How do i make it print the image? i am trying to use img src, but not seeing any output 😕
2) my search function runs only for single value. I want it to run for multiple values separated by comma.
my code so far is:
if(!$connect)
{
die('Could not connect: ' . mysql_error()); //error message if no connect
}
mysql_select_db(); //select the database from the server
$sql = "select img_path_name from key_list WHERE key_one like '%$search_item' || key_two like '%$search_item'|| key_three like '%$search_item'|| key_four like '%$search_item'|| key_five like '%$search_item'|| key_six like '%$search_item'";
$result = mysql_query($sql,$connect);
while ($r = mysql_fetch_array($result))
{
//echo "<td>" . "<img src=\"/images/www_images/www_images/" . $r[0] . "\" >" . "</td>";
} // end while
}
else
{
echo "Search string is empty";
}
Please help me identify whats wrong with this code!!!!! Thanks..