Hiya,
I have used the code you said and it now shows where the image should be .
I'm not sure if it isnt finding the image from the database - as i have checked the address for the images and that is correct.
How should the image be stored in the database - i have done it as longblob binary, is this right??
here is the code:
<?php
include_once ("../sallysurfconnection/header.html");
$page_title = 'find_customer_results.php';
?>
<!--Space layout image positioning-->
<td colspan="8" valign="top">
<img src="C:\Program Files\EasyPHP1-7\www\Images\1pix.jpg" width="561" height="9">
<h2>Find Customer search results:</h2>
<?php
//create short variable names
$searchtype=$POST["searchtype"];
$searchterm=$POST["searchterm"];
$searchterm= trim($searchterm);
if (!$searchtype || !$searchterm)
{
echo '<p><font color="red">You have not entered search details. Please go back and try again.</font></p>';
exit;
}
$searchtype = addslashes($searchtype);
$searchterm = addslashes($searchterm);
@ $db = mysql_pconnect("localhost","Admin","admin");
@mysql_select_db(surf_management) OR die ('Could not select the database: '.mysql_error()); //select which database to connect to
if (!$db)
{
echo '<p><font color="red">Error: Could not connect to database. Please try again later.</font></p>';
exit;
}
$query = "SELECT * FROM customer_table WHERE ".$searchtype." like '%".$searchterm."%'LIMIT 3 ";
$result = mysql_query($query)or die(mysql_error());
$num_results = mysql_num_rows($result);
echo '<P><strong>Number of items found: '.$num_results.'</strong></p>';
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
echo '<p><strong>'.($i+1).'.Customer Number: ';
echo htmlspecialchars(stripslashes($row['Cust_Id']));
echo '</strong><br />First Name: ';
echo stripslashes($row['First_Name']);
echo '<strong><br />Surname: ';
echo stripslashes($row['Surname']);
$image = stripslashes($row['Image']);
$dispimage = "<img src='C:\Program Files\EasyPHP1-7\www\Catimages\$image'>";
echo $dispimage;
//echo '<strong><br />Image: ';
//echo stripslashes($row['Image']);
//Header ("Content-type: $image_type");
//print $image;
//echo '</p>';
}
//if $num_result > LIMIT then
include_once ("../sallysurfconnection/footer.html");
?>
thanx