NOUVELLE VERSION !!! Des nouvelles classes de partout, et des supers procédures SQL.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
class Article {
|
||||
|
||||
|
||||
public static function getNewest($count){
|
||||
$req = $GLOBALS['bdd']->prepare('SELECT * FROM articles ORDER BY lastNoticeableChangeDate DESC LIMIT '.intval($count));
|
||||
$req->execute();
|
||||
$reps = array();
|
||||
while($rep = $req->fetch()){
|
||||
$reps[] = array();
|
||||
$reps[count($reps)-1]['title'] = $rep['title'];
|
||||
$reps[count($reps)-1]['short'] = $rep['short'];
|
||||
$reps[count($reps)-1]['text'] = $rep['text'];
|
||||
$reps[count($reps)-1]['picPath'] = $rep['picPath'];
|
||||
|
||||
}
|
||||
return $reps;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user