【发布时间】:2015-07-16 18:26:42
【问题描述】:
当从 PHP 的 while 循环中选择图像时,我想将它们放在一起。
所以,目前看起来像这样http://prntscr.com/7tb42j
而且我希望它可以将图像并排放置。
我的 foreach 循环如下所示:
<div id='profile-album'>
<?php
$get_fotos = "SELECT * FROM fotos_profile WHERE username=:username LIMIT 4";
$stmt = $db->prepare($get_fotos);
$stmt->bindParam(':username', $username);
$stmt->execute();
foreach($stmt as $row)
{
$pic = $row['pic'];
$title_foto = $row['title'];
?>
<div id='album-foto-1'><img src="userdata/profile_fotos/<?php echo $pic; ?>" height='100px' width='206px' style='padding-right: 6px'/></div>
<?php } ?>
【问题讨论】: