Historisation Exemple

Exemple test historisé
This commit is contained in:
2018-10-21 18:37:25 +02:00
commit ba3d8f06f6
153 changed files with 32155 additions and 0 deletions

View 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;
}

View File

@@ -0,0 +1,11 @@
<?php
// Connexion <20> la base de donn<6E>es
try
{
$bdd = new PDO('mysql:host=localhost;dbname=test', 'root', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}