-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.php
23 lines (20 loc) · 720 Bytes
/
post.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php include 'includes/header.php'; ?>
<?php
$id = $_GET['id'];
//Create DB Object
$db = new Database();
//Create Query
$query = "SELECT * FROM posts WHERE id = ".$id;
//Run Query
$post = $db->select($query)->fetch_assoc();
//Create Query
$query = "SELECT * FROM categories";
//Run Query
$categories = $db->select($query);
?>
<div class="blog-post">
<h2 class="blog-post-title"><?php echo $post['title']; ?></h2>
<p class="blog-post-meta"><?php echo formatDate($post['date']); ?> by <a href="#"><?php echo $post['author']; ?></a></p>
<?php echo $post['body']; ?>
</div><!-- /.blog-post -->
<?php include 'includes/footer.php'; ?>