You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
578 B
PHTML

<?php
require_once("model/db.php");
require_once("controller/listLatest.php");
?>
<div class="content">
<?php
$where = "5";
$what = "article";
$array = listLatestArticle($pdo, $where);
?>
<h2>NEWS:</h2>
<?php foreach($array as $row) : ?>
<div class="box">
<article>
<a href="<?= $what ?>.php?id=<?= $row['id'] ?>" ><h2><?= $row['title'] ?></h2></a> Published on:<time pubdate="pubdate"> <?= $row['time'] ?> </time>
<p><em> <?= substr($row['body'],0 ,120) ?>...</em></p>
</article>
</div>
<?php endforeach; ?>
</div>