Historisation Exemple
Exemple test historisé
This commit is contained in:
16
blog_mvc/modele/blog/get_billets.php
Normal file
16
blog_mvc/modele/blog/get_billets.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?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 <20> %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;
|
||||
}
|
||||
Reference in New Issue
Block a user