diff --git a/lib/newsarticle.php b/lib/newsarticle.php
new file mode 100644
index 0000000..2289a24
--- /dev/null
+++ b/lib/newsarticle.php
@@ -0,0 +1,20 @@
+query("SELECT NewsArticles.ID, NewsArticles.WrittenAt, NewsArticles.WrittenBy, NewsArticles.Title, NewsArticles.Body, NewsArticles.FileList Users.Nickname FROM NewsArticles INNER JOIN Users ON NewsArticles.WrittenBy = Users.ID; ");
+
+ // Check if the query executed Successfully
+ if ($result) {
+ while ($row = $result->fetch_assoc()) {
+ $articles[] = $row;
+ }
+ }
+ }
+
+ return $articles;
+}
\ No newline at end of file
diff --git a/pages/news/index.html b/pages/news/index.html
deleted file mode 100644
index 34116ae..0000000
--- a/pages/news/index.html
+++ /dev/null
@@ -1,8 +0,0 @@
- Adlerka študentské news Rohová časť stola v a A103 spáchala samovraždu po dotyku Richarda Mikloša!!!
-
$articleWrittenAt
+Adlerka študentské news
+