Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $query = 'SELECT DATE_FORMAT(articles.posted, \'%Y%b%d\') as `date`,';
- $query .= ' DATE_FORMAT(articles.posted, \'%l:%i %p\') as `time`, articles.id,';
- $query .= ' articles.title, SUBSTRING(articles.content, 1, 220) as `content`, articles.categoryId,';
- $query .= ' articleComments.articleId';
- $query .= ' FROM articles, articleComments';
- $query .= ' WHERE articles.visible = 1';
- $query .= ' AND articles.id = articleComments.articleId';
- $query .= ' ORDER BY id DESC LIMIT 6';
- $result = mysql_query($query, $dbCon)or die('Unable to read from table. <br/>' . mysql_error() . '<br/>');
- ?>
- <?php while($row = mysql_fetch_assoc($result)) { ?>
- <div id="latshad" class="latest corners shadow">
- <a href="article.php?cat=<?php echo $row['categoryId']; ?>&id=<?php echo $row['id']; ?>">
- <div class="inner corners">
- <div class="pic corners">
- <img src="avatars/<?php echo rand(1,3); ?>.jpg">
- <div class="topGlare">
- </div>
- <div class="botGlare">
- </div>
- </div>
- <div class="data corners">
- <h2><?php echo $row['title']; ?></h2>
- <h4><?php echo $row['date']; ?> at <?php echo $row['time']; ?></h4>
- <?php echo $row['articleId']; ?>
- <hr />
- <p>
- <?php echo $row['content']; ?> - ....
- </p>
- </div>
- </div>
- </a>
- </div>
- <?php } ?>
- <br class="clear">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement