setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo "Webseite wird momentan überarbeitet"; } function fetch_text($id) { global $conn; $stmt = $conn->prepare('select text from text where id = :id LIMIT 1;'); $stmt->bindParam(':id', $id); $stmt->execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); return $result['text']; } function timeformat($time) { $t = strtotime($time); if(date('i', $t) != 0) { return strftime("%d.%m (%H.%M h)", $t); } return strftime("%d.%m (%H h)", $t); } $stmt = $conn->prepare('select DISTINCT LPAD( month(time), 2, \'0\') as `nr` from events_onwebsite'); $stmt->execute(); $first = true; $timetitle = ''; $sitetitle = ''; foreach($stmt->fetchAll() as $month) { if(!$first){ $timetitle .= '/'; $sitetitle .= '/'; } $timetitle .= ''.$month['nr'].''; $sitetitle .= $month['nr']; $first = false; } ?>