Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- /*
- Directory: /news/home.php
- Scripted by: Daniel Szczech
- */
- $news_id = $_GET['newsid'];
- if(!$news_id) {
- $news = mysql_query("SELECT * FROM `hp_news` ORDER BY `id` DESC");
- if(mysql_num_rows($news) == 0) {
- echo "There is no any news!";
- } else {
- while($news_result = mysql_fetch_array($news)) {
- $comments_query = mysql_query("SELECT * FROM `hp_news_comments` WHERE `news_id`='".$news_result['id']."'");
- $comments = mysql_num_rows($comments_query);
- echo "Title: ".$news_result['title']."<br />";
- echo "Content: ".$news_result['content']."<br />";
- echo "> ><a href='?page=news/home.php?newsid=".$news_result['id']."'>More / Comments ($comments)</a>< <<br />";
- echo "------------------------------------------------------<br />";
- }
- }
- } else {
- echo "inside the news!";
- }
- ?>
Add Comment
Please, Sign In to add comment