Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('configs/pdo.inc.php');
- include('libs/Smarty.class.php');
- // create object
- $smarty = new Smarty;
- // Nieuws ophalen
- try {
- $query = $oPDO->prepare("SELECT * FROM T_Nieuws ORDER BY D_id DESC LIMIT 5");
- $query->execute();
- $smarty->assign('nieuws', $query->fetchAll());
- $t = array();
- foreach ($query as $row) {
- $t[$row['id']] = $row;
- }
- $smarty->assign('content', $t);
- } catch (PDOException $e) {
- echo '<pre>';
- echo 'Regelnummer: ' . $e->getLine() . '<br>';
- echo 'Bestand: ' . $e->getFile() . '<br>';
- echo 'Foutmelding: ' . $e->getMessage() . '<br>';
- echo '</pre>';
- }
- // display it
- $smarty->display('extends:layout.tpl|header.tpl|nieuws.tpl|footer.tpl');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement