Files
ExempleWeb/blog_mvc/modele/blog/get_billets.php
DARKNAGAN ba3d8f06f6 Historisation Exemple
Exemple test historisé
2018-10-21 18:37:25 +02:00

17 lines
521 B
PHP

<?php
function get_billets($offset, $limit)
{
global $bdd;
$offset = (int) $offset;
$limit = (int) $limit;
$req = $bdd->prepare('SELECT id, titre, contenu, DATE_FORMAT(date_creation, \'%d/%m/%Y à %Hh%imin%ss\') AS date_creation_fr FROM billets ORDER BY date_creation DESC LIMIT :offset, :limit');
$req->bindParam(':offset', $offset, PDO::PARAM_INT);
$req->bindParam(':limit', $limit, PDO::PARAM_INT);
$req->execute();
$billets = $req->fetchAll();
return $billets;
}