This is my code, I wanna display all records, but show all except picture not displayed. use mysql, php.
CREATE TABLE newitem (
product_id varchar(255) NOT NULL default '',
p_name varchar(50) NOT NULL default '',
description text,
p_price float(5,2) default NULL,
picture longblob,
PRIMARY KEY (product_id)
) TYPE=MyISAM;
<?
include("include/header.php");
header_html("New Product");
//header("Content-type:image/jpeg");
$db=mysql_connect("localhost","siribunga","bunga9");
if(!$db)
{
echo "Error connection";
exit;
}
mysql_select_db("mydb");
$sql="select * from newitem";
$result=mysql_query($sql);
echo "<br>";
echo "<font face='Tahoma'><b>";
echo "<table align=center width='550'>";
echo "<tr height=10>";
echo "<td> </td>";
echo "</tr>";
echo "<tr bgcolor=EEBB77 height='25'>";
echo "<td>New Product</td>";
echo "</tr>";
echo "</table>";
echo "<table align=center>";
while($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
//$file_name = base64_decode($row['picture']);
$file_name = $row['picture'];
echo "<tr>";
//echo "<td>".$file_name."</td>";
echo "<td><img src=\"".$file_name."\"></td>";
echo "</tr>";
echo "<tr>";
echo "<td>Product_ID</td>";
echo "<td>".$row['product_id']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Name</td>";
echo "<td>".$row['p_name']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Description</td>";
echo "<td>".$row['description']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Price</td>";
echo "<td>".$row['p_price']."</td>";
echo "</tr>";
}
echo "</table>";
echo "</b></font>";
include("include/footer.php");
mysql_close($db);
?>