When it comes to displaying the 48 B Image file would not show.
[code1] This is the code that I am using to insert the image from the back-end.
if(isset($_POST['submit'])){
$pid = mysql_real_escape_string($_POST['productID']);
$productName = mysql_real_escape_string($_POST['productName']);
$productImg = mysql_real_escape_string($_POST['productImg']);
$insert = mysql_query("INSERT INTO products (productID, productName, productImg) VALUES ('$pid', '$productName', '$productImg')");
if($insert)
{
echo 'Successfully added new record.';
} else {
echo 'Failed to add new record because '.mysql_error();
}
} ?>
[code2] and this is the code that I am using to display the image from the front-end.
while($row = mysql_fetch_array($query)){
echo '<tr>
<td>'.$row['productID'].'</td>
<td>'.$row['productName'].'</td>
<td>'.
'<img src="data:image/jpg;base64,'.base64_encode($row['productImg']).'" width="auto" height="150" class="img-thumnail"/>'
.'</td>