【问题标题】:arranging images in xampp database在 xampp 数据库中排列图像
【发布时间】:2013-03-28 03:16:10
【问题描述】:

我在 php 中有这段代码。我希望我的图像显示为水平显示。这些图像保存在 xampp 中。有谁能够帮我?这是我的代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
mysql_connect("localhost","root","");
mysql_select_db("dbLetters");
$res=mysql_query("select * from tbLetters");
echo "<table>";
while ($row = mysql_fetch_array($res))
{
echo "<tr>";
echo "<td>";?> <img src = "<?php echo $row["images"]; ?>"  height="200" width="200"> <? php echo "</td>";
echo "</tr>";

}
echo "</table>";
?>

</body>
</html>

your response will be a big help. thanks. :))

【问题讨论】:

标签: php image xampp


【解决方案1】:

除非您使用数据 url,否则您实际上需要设置一个单独的脚本来拉取,该脚本会将图像提供给浏览器。

这将使您的图片网址类似于image.php?id=&lt;image_id&gt;。 image.php 脚本将获取图像并将图像提供给浏览器。

在 mysql 中存储图像数据通常不是一个好主意。

【讨论】:

  • 这些图像有自己的特定任务,所以我必须将它们放入数据库中。知道我将如何安排它们吗?还是不可能?
猜你喜欢
  • 1970-01-01
  • 2016-08-21
  • 2021-03-20
  • 2017-12-15
  • 1970-01-01
  • 2018-09-10
  • 2021-08-31
  • 2019-03-22
  • 2018-09-04
相关资源
最近更新 更多