我已经使用一个文本框将图像存储到SQL数据库,并将其存储在数据库中,但是我怎么不能从数据库中检索图像。我使用以下代码显示,但无法正常工作
// Grab the data from our people table
$sql = "select * from upload";
$result = mysql_query($sql) or die("Could not access DB: " . mysql_error());
while ($row = mysql_fetch_assoc($result)) {
echo "<div class=\"picture\">";
echo "<p>";
// Note that we are building our src string using the filename from the database
echo "<img src=$row['data']/>";
echo $row['title'] . " " . $row['title'] . "<br />";
echo "</p>";
echo "</div>";
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句