Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try {
- $dbh = new PDO("mysql:host=$hostname;dbname=tag_website", $username, $password);
- }
- catch(PDOException $e) {
- $e->getMessage();
- }
- $sql = "SELECT * FROM blogs";
- foreach ($dbh->query($sql) as $row) {
- $author = $row['author'];
- $title = $row['title'];
- $date = $row['date'];
- $body = $row['body']; ?>
- <div id="main" class="blog">
- <div class="inner-wrap clearfix">
- <div class="content content-left">
- <article class="post post-blog clearfix">
- <h3 class="post-title"><a href="blog-single.html"><? $title ?></a></h3>
- <a href="blog-single.html" class="post-image">
- <img src="assets/placeholder-615x140.png" width="615" height="140" alt="Post Image" />
- </a>
- <div class="post-meta">
- <span class="date"><? $date ?></span>
- <a class="comment-count" href="blog-single.html#comment-list">2</a>
- <ul class="categories-list">
- <!-- AUTHOR HERE --> <li><a href="#"><? $author ?></a></li>
- <!-- SUBJECT HERE CONSIDER DELETION --> <li><a href="#">News</a></li>
- </ul>
- </div><!-- end .post-meta -->
- <div class="post-content">
- <? $body ?>
- </div><!-- end .post-content -->
- </article><!-- end .post -->
- <hr />
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement