diff --git a/article-form.php b/article-form.php index e69de29..a3f8a6a 100644 --- a/article-form.php +++ b/article-form.php @@ -0,0 +1,35 @@ + + + + + + + + + + + + +
+
+ + title:
+ body:
+ + + + diff --git a/article-list.php b/article-list.php index e69de29..d29ebe7 100644 --- a/article-list.php +++ b/article-list.php @@ -0,0 +1,27 @@ +connect_error) { + die("Connection failed: " . $conn->connect_error); +} + +$sql = "SELECT article_id, author_user_id, title, body, publish_date FROM cm_blog.article ORDER BY publish_date DESC"; +$result = $conn->query($sql); + +if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + echo ""; +echo "" .$row['article_id']. ""; echo "" .$row['author_user_id']. ""; echo "" .$row['title']. ""; echo "" .$row['body']. ""; echo "" .$row['publish_date']. ""; echo ""; + } +} else { + echo "0 results"; +} +$conn->close(); +?>