OK guys, ive done the following instead and made the display element in a new file.
$item_no=21547980;
$DB_SERVER="localhost"; // Database Server machine
$DB_LOGIN="admin"; // Database login
$HTTP_HOST="//localhost"; // HTTP Host
$DOCROOT="project"; // Path, where application is installed
$ADMIN_FULL_PATH="localhost/project/admin"; // The path to the admin folder
if (!($link = mysql_pconnect($DB_SERVER, $DB_LOGIN, $DB_PASSWORD))){
DisplayErrMsg(sprintf("internal error %d:%s\n", mysql_errno(), mysql_error()));
exit() ;
}
if (!(mysql_select_db($DB,$link))) {
echo("<br>");
echo("<br>");
echo ("<font color=red> Cannot Connect To Database Table");
exit();
}
$query = "select bin_data,filetype from inventory where item_no='$item_no'";
$search = @MYSQL_QUERY("$query");
$data = @MYSQL_RESULT($search,0,"bin_data");
$type = @MYSQL_RESULT($search,0,"filetype");
$search="select * from inventory where item_no='$item_no';";
$query = mysql_query("$search");
$myrow = mysql_fetch_row(mysql_query($search,$link));
Header( "Content-type: $type");
echo ("$data");
echo ("<tr><td>Image Upload:</td><td>");
echo ("<table align=center border=1>");
echo ("<tr><td>Item no:</td><td>$myrow[0] </td></tr>");
echo ("<tr><td>Title:</td><td>$myrow[6] </td></tr>");
echo ("<tr><td>Artist:</td><td>$myrow[7] </td></tr>");
echo ("<tr><td>Category:</td><td>$myrow[1] </td></tr>");
echo ("<tr><td>Format: </td> <td>$myrow[8] </td></tr>");
echo ("<tr><td>No Of CD's:</td><td>$myrow[9] </td></tr>");
echo ("<tr><td>Price:</td> <td>$myrow[12] </td></tr>");
echo ("<tr><td>Sale Price:</td><td>$myrow[13] </td></tr>");
echo ("<tr><td>Stock Level:</td><td>$myrow[14] </td></tr>");
echo ("<tr><td>Reorder Level:</td><td>$myrow[15] </td></tr>");
echo ("</td></tr>");
echo ("<tr><td>Track Info:</td><td>$myrow[10] </td></tr>");
echo ("<tr><td>Description:</td><td> $myrow[11]</td></tr></table>");
echo ("<table align=center><tr><td><form method=post action=inventory_create2.php?item_no=$item_no><input type=submit value='Go Back'></form></table>");
?>
But when i call the script, the image file is displayed only... nothing else happens i.e. the table is not displayed, any thoughts why it only displays the image?
I have commented the lines:
Header( "Content-type: $type");
echo ("$data");
to see what happens and the table gets displayed
Have i missed something
In addition, is there away of displaying the image so that i can see it as a thimb nail? i tried
echo ("<img src='$data' height=300 width=300 />");
but only the machine code came on the screen.
Any help will be great.
Many Thanks
Sunit
😕 🙁