hi
i am first time using blob files .When i use the blob file to diaplay data it is shown in binary format and i want to diplay that in image format.i am using the following code to extract image and show it.
Please help me to solve the problem
i am first time using blob files .When i use the blob file to diaplay data it is shown in binary format and i want to diplay that in image format.i am using the following code to extract image and show it.
Code:
<?php $mysql=mysql_connect("localhost", "root", ""); mysql_select_db("skm") or die(mysql_error()); $sql = "SELECT emp_code,emp_mail,emp_picture FROM emp"; $result = mysql_query($sql) or die("Invalid query: " . mysql_error()); echo "<table><tr> <th>Emp Code</th> <th>Emp Name</th> </tr>"; while($row=mysql_fetch_array($result)) { echo "<tr>"; echo "<td>{$row['emp_code']}</td>"; echo "<td>{$row['emp_mail']}</td>"; echo "<td>"; $image=($row['emp_picture']); header("Content-type: image/jpg"); echo $image; echo " </td>"; echo "</tr>"; } echo "</table>"; mysql_close($mysql); ?>
Comment