prepare('SELECT postID FROM blog_posts_seo WHERE postDate >= :from AND postDate <= :to'); $stmt->execute(array( ':from' => $from, ':to' => $to )); //pass number of records to $pages->set_total($stmt->rowCount()); $stmt = $db->prepare('SELECT postID, postTitle, postSlug, postAuthor, postDesc, postDate FROM blog_posts_seo WHERE postDate >= :from AND postDate <= :to ORDER BY postID DESC '.$pages->get_limit()); $stmt->execute(array( ':from' => $from, ':to' => $to )); echo '

Archives : '.$month.'-'.$year.'


'; while($row = $stmt->fetch()){ echo '
'; echo ''.html($row['postTitle']).''; echo '
Posté le '.date_fr('l j F Y à H:i:s', strtotime(html($row['postDate']))).' par '; echo html($row['postAuthor']).' dans '; $stmt2 = $db->prepare('SELECT catTitle, catSlug FROM blog_cats, blog_post_cats WHERE blog_cats.catID = blog_post_cats.catID AND blog_post_cats.postID = :postID'); $stmt2->bindValue(':postID', $row['postID'], PDO::PARAM_INT); $stmt2->execute(); $catRow = $stmt2->fetchAll(PDO::FETCH_ASSOC); $links = array(); foreach ($catRow as $cat) { $links[] = "".html($cat['catTitle']).""; } echo implode(", ", $links); echo '
'; } echo '

'; echo $pages->page_links("a-$month-$year&"); } catch(PDOException $e) { echo $e->getMessage(); } ?>