Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2.  
  3. include('configs/pdo.inc.php');
  4. include('libs/Smarty.class.php');
  5.  
  6. // create object
  7. $smarty = new Smarty;
  8.  
  9. // Nieuws ophalen
  10. try {
  11.     $query = $oPDO->prepare("SELECT * FROM T_Nieuws ORDER BY D_id DESC LIMIT 5");
  12.     $query->execute();
  13.     $news = $query->fetchAll();
  14.     $smarty->assign('nieuws', $news);
  15.  
  16.     //$oResult = $query->fetchAll();
  17. } catch (PDOException $e) {
  18.     echo '<pre>';
  19.     echo 'Regelnummer: ' . $e->getLine() . '<br>';
  20.     echo 'Bestand: ' . $e->getFile() . '<br>';
  21.     echo 'Foutmelding: ' . $e->getMessage() . '<br>';
  22.     echo '</pre>';
  23. }
  24.  
  25. // display it
  26. $smarty->display('extends:layout.tpl|header.tpl|nieuws.tpl|footer.tpl');
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement