描述->我只是想在我的网页上从数据库中获取图像,我已经给了BLOB类型的数据库,我在哪里存储图像,我如何获取该图像,在这段代码中,我正在获得图像的小图标与损坏的格式。
<?php
$connection = mysqli_connect("localhost", "****", "******","****");
$find_data =mysqli_query($connection,"SELECT * FROM ashish " );
while($row = mysqli_fetch_assoc($find_data)){
$current=$row['weblink'];$asdf=$row['webrate'];$imag =$row['weblogo'];
$ima =$row['weblogo'];
}
?>
<form action="ashishdb" method="post" enctype="multipart/form-data">
<div><p>WebSite Link :<input type="text" name="weblink"> Websites Rating : <input type="text" name="webrate"> Website Logo : <input type="file" name="weblogo"></p>
<p align="center"><input type="submit" value="Submit" name="btn_file"></p>
</div>
<table style="width:100%">
<tr>
<th>A</th>
<th>A</th>
<th>A</th>
</tr>
<tr>
<td><?php echo $current ?></td>
<td><?php echo $asdf ?></td>
<td><img src=<?php echo $ima ?> ></td>
</tr>
</table>
</form>
</body></html>
如果您的"ashish"表"weblogo"列包含图像的路径或url,您可以尝试:
<img src="<?php echo $ima; ?>" >
或
<img src="<?=$ima?>" >