我正在尝试从数据库中获取所有文章和图片$。 问题是我无法弄清楚如何根据文章ID获取图像:
<?php include('navindex.php');?>
<div class="container">
<?php
include('pdo.php');
/*
$sql = "SELECT * FROM annonce WHERE id_annonce =:id";
$query = $open->prepare($sql);
*/
$sql = "SELECT * FROM annonce WHERE id_annonce=id_annonce";
//$sql = "SELECT * FROM widgets WHERE something='something else'";
/*
foreach ($open->query($sql) as $results)
{
$id = $results["id_annonce"];
}
*/
//print_r($result);
?>
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<img src="image/thumbnail.png">
<div class="caption">
<h3>Titre d'annonce</h3>
<p>prix 200</p>
<p>surface 400</p>
</div>
</div>
</div>
</div>
</div>
<?php include('footer.php'); ?>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
主屏幕应如下所示: