Hi,
ich habe da mal ein kleines Problem. Nach dem wechsel der phpBB Standalone SQL Klasse auf PDO will meine SQL Abfrage nicht mehr.
Es sollen alle Beiträge aus dem Monat und Jahr ausgegeben werden. article.php?page=archiv&m=12&y=2014
Alles anzeigen
ich habe da mal ein kleines Problem. Nach dem wechsel der phpBB Standalone SQL Klasse auf PDO will meine SQL Abfrage nicht mehr.
Es sollen alle Beiträge aus dem Monat und Jahr ausgegeben werden. article.php?page=archiv&m=12&y=2014
PHP-Quellcode
- public function archiv($month, $year) {
- global $lang, $Smarty, $Core;
- $ARTICLE_CAT = array();
- $last_day = date('t', mktime(0, 0, 0, $month, 1, $year));
- $start_date = mktime(0, 0, 0, $month, 1, $year);
- $end_date = mktime(23, 59, 59, $month, $last_day, $year);
- $sql = "SELECT c.*, p.* FROM " . BLOG_CAT . " c LEFT JOIN " . BLOG_POST . " p on (c.cat_id = p.cat_id) WHERE p.post_date >= '" . $start_date . "' AND p.post_date <= '" . $end_date . "'ORDER BY p.post_time DESC";
- $stmt = MyDB::getInstance()->prepare($sql);
- $stmt->execute();
- while ($row = $stmt->fetch()) {
- $row['post_time'] = $Core->userdate($row['post_time']);
- $row['post_text'] = ($row['read_position'] > 0) ? substr(htmlspecialchars_decode($row['post_text']), 0, $row['read_position']) : htmlspecialchars_decode($row['post_text']);
- $ARTICLE_CAT[] = $row;
- }
- }