-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
46 lines (46 loc) · 2.26 KB
/
Copy pathsingle.php
File metadata and controls
46 lines (46 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php include 'header.php'; ?>
<div id="main-content">
<div class="container">
<div class="row">
<div class="col-md-8">
<!-- post-container -->
<div class="post-container">
<?php
include "config.php";
$id = $_REQUEST['id'];
$sql = "SELECT * FROM news_post
LEFT JOIN news_category ON news_post.category = news_category.category_id
LEFT JOIN news_user ON news_post.author = news_user.user_id
WHERE post_id={$id} ";
$result = mysqli_query($conn,$sql) or die("Query Failed");
$row = mysqli_fetch_assoc($result);
?>
<div class="post-content single-post">
<h3><?php echo $row['title']; ?></h3>
<div class="post-information">
<span>
<i class="fa fa-tags" aria-hidden="true"></i>
<?php echo $row['category_name']; ?>
</span>
<span>
<i class="fa fa-user" aria-hidden="true"></i>
<a href='author.php'><?php echo $row['username']; ?></a>
</span>
<span>
<i class="fa fa-calendar" aria-hidden="true"></i>
<?php echo $row['post_date']; ?>
</span>
</div>
<img class="single-feature-image" src="admin/upload/<?php echo $row['post_img']; ?>" alt=""/>
<p style="line-height: 25px;" class="description lead">
<?php echo $row['description']; ?>
</p>
</div>
</div>
<!-- /post-container -->
</div>
<?php include 'sidebar.php'; ?>
</div>
</div>
</div>
<?php include 'footer.php'; ?>