setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // prepare sql and bind parameters $stmt = $dbConnection->prepare("INSERT INTO cwsvjudo.nachrichtenDev (datum, betreff, nachricht, autor, promoImg) VALUES (:datum, :betreff, :nachricht, :autor, :promoImg)"); $stmt->bindParam(':datum', $newsArticle['datum']); $stmt->bindParam(':betreff', iconv("UTF-8", "ISO-8859-1", $newsArticle['betreff'])); $stmt->bindParam(':nachricht', iconv("UTF-8", "ISO-8859-1", $Parsedown->text( $newsArticle['text'] ))); // $stmt->bindParam(':nachricht', $Parsedown->text( htmlspecialchars( $newsArticle['text'] ) )); // $stmt->bindParam(':nachricht', iconv("UTF-8", "ISO-8859-1", $Parsedown->text($newsArticle['text']))); $stmt->bindParam(':autor', $newsArticle['autor']); $stmt->bindParam(':promoImg', $newsArticle['promoImg']['url']); // insert a row $stmt->execute(); echo "New records created successfully"; } catch(PDOException $e){ echo "Error: " . $e->getMessage(); } $dbConnection = null; } } ?> Nachrichtenadministration $newsArticle['datum'], 'betreff' => $newsArticle['betreff'], 'promoImg' => $newsArticle['promoImg']['url'], 'nachricht' => Parsedown::instance()->text($newsArticle['text']), 'autor' => $newsArticle['autor'] )));?>

"/>
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $newsList = getNews($dbConnection, array('limit'=>6)); } catch(PDOException $e){ echo "Error: " . $e->getMessage(); } $dbConnection = null; if(!empty($newsList)) foreach( $newsList as $news) echo("
".getHtmlNews($news)); else echo("Keine Nachrichten gefunden!") ?>