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 .= ' COUNT(articleComments.articleId) as `count`';
- $query .= ' FROM articles';
- $query .= ' JOIN articleComments';
- $query .= ' ON articles.id = articleComments.articleId';
- $query .= ' WHERE articles.visible = 1';
- $query .= ' GROUP BY articleComments.articleId DESC LIMIT 6';
- $result = mysql_query($query, $dbCon)or die('Unable to read from table. <br/>' . mysql_error() . '<br/>');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement