答案 0 :(得分:0)
在你的循环中构建两个HTML条目系列,一个用于你的标题,另一个用于你的pictrures。然后将每个HTML字符串回显到您希望它们的div。
<?php
titlesHTML = "";
imagesHTML = "";
foreach ($result as $row) {
$contentTitle = $row['cont_title'];
$contentImage = $row['cont_picture'];
$titlesHTML .= "<p>" . $contentTitle . "</p>";
$imagesHTML .= "<p>" . $contentImage . "</p>";
// if you want not to echo the image location but the image itself try the following code instead:
// $imagesHTML .= "<img src='" . $contentImage . "'>";
}
?>
<div class="row">
<div class="col-em-12">
<?php echo $titlesHTML; ?>
</div>
<div>
<div class="row">
<div class="col-em-12">
<?php echo $imagesHTML; ?>
</div>
<div>