ok I uploaded images in a folder in my directory and uploaded the image detail to mysql database, the image has the same name as the id
so if the id = 1 the image will be named 1.jpg
this code is made for a search bar, so i would have a search bar in a separate page which link to this
all my product will be listed here and when someone searches for a product it will show them only the spesific product they searched for
my problem is i can’t get the image up the so please help me
thank you
this is the code:
[php]
Store Admin Area
<body>
<div align="center" id="wrapper">
<?php include_once("template_header_user_login.php");?>
<div id="content">
<?php
include “…/storescripts/connect_to_mysql.php”;
$term = $_POST[‘term’];
$sql = mysql_query(“select * from products where product_name like ‘%$term%’ or price like ‘%$term%’ or details like ‘%$term%’ or category like ‘%$term%’ or subcategory like ‘%$term%’ or date_added like ‘%$term%’”);
while ($row = mysql_fetch_array($sql)){
echo “
”; echo 'ID: '.$row[‘id’]; echo “ | ”;
” ; echo ’ Product Name: '.$row[‘product_name’]; echo “ | ”;
”; echo ’ Price: £ '.$row[‘price’]; echo “ | ”;
”; echo ’ Detail: '.$row[‘details’]; echo “ | ”;
”; echo ’ Category: '.$row[‘category’]; echo “ | ”;
”; echo ’ SubCategory: '.$row[‘subcategory’]; echo “ | ”;
”; echo ’ Date Added: '.$row[‘date_added’]; echo “ | ”;
}
?>
<?php include_once("template_footer_user_login.php");?>
[/php]
this is the search bar code
<form action="search.php" method="post">
Search: <input type="text" name="term" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
more detail: I want it to select the image with the same id as the product and import it
I was able to do that while using php url, but i didn’t know how to do it here
please help thanks