【发布时间】:2012-10-07 21:51:38
【问题描述】:
我有一个包含电影名称、描述和封面图片的数据库。封面图片字段类型为 blob,问题是我无法从数据库中检索它。我想在他们旁边的封面图片上显示电影名称...怎么做..这是我的代码..
<?php
include ("php/connection.php");
$ID = $_GET['id'];
$listmovies = "SELECT * FROM movies where Genres LIKE '%$ID%'";
$result = mysql_query($listmovies);
while ( $row = mysql_fetch_assoc($result) ) {
?>
<table border="1" width="100%">
<tr>
<td rowspan="2" width="90" height="120">
<?php
// set the header for the image
header("Content-type: image/jpeg");
echo $row['Image'];
?> </td>
<td width="200" height="10">
<?php
echo $row['Title'];
?></td>
</tr>
<tr>
<td width="200" height="110"><a
href="php/moredetails.php?id=<?php echo $row['ID']; ?>">More Detail</a></td>
</tr>
<?php } ?> </table>
我只想在电影标题旁边显示 The Imgaes?
【问题讨论】:
-
最好不要将图像直接存储在数据库中,而是将图像存储在文件系统上的路径,然后可以将其转换为 URL。
-
在你的实现中添加更多细节和代码......你也可以删除标题看看你是否有一些语法错误