0

我想在这个 HTML 表中显示我存储在数据库中的图像。我已将文件存储为“BLOB”,并且希望将图像显示在“照片”列下。我用什么代码来回显图像?

    <table wactidth='100%' border='1' cellspacing='0' align="center">
    <thead align='left'>
        <th>Photo</th>
        <th>Act Name</th>   
        <th>Genre</th>
        <th>First Name</th>
        <th>Last Name</th>
        <th>Number of People</th>
        <th>Actions</th>

    </thead>
    <tbody>
    <?php foreach($acts as $act):?>
        <tr>
            <td><!-- I WANT TO DISPLAY THE IMAGES UNDER THIS COLUMN--></td>
            <td><?php echo $act['ActName'];?></td>
            <td><?php echo $act['Genre'];?></td>
            <td><?php echo $act['ContactFirstName'];?></td>
            <td><?php echo $act['ContactLastName'];?></td>
            <td><?php echo $act['NumberOfPeople'];?></td>
            <td><a href="?editact&actid=<?php echo $act['actid'];?>">Edit</a>|<a href="?delete&actid=<?php echo $act['actid'];?>">Delete</a>|<a href="upload&actid=<?php echo $act['actid'];?>">Upload Image</td>
        </tr>
    <?php endforeach?>
    </tbody>
</table>
4

1 回答 1

0

I would recommend storing just the paths to the images, like "/path/to/your/image.jpg". Then you can echo out the path just like a string

<td><img src="<?php echo $act['imagepath'];?>" alt="" /></td>
于 2013-02-01T16:29:41.650 回答