Advertisement
irishstorm

r;kjuget

May 2nd, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <link href="mainstyle.css" rel="stylesheet" type="text/css">
  2. <title>News</title>
  3. <?php
  4. $time = time() + 60 + 60 + 24 + 7;
  5.  
  6. // Connect to the database.
  7. // mysql_connect("localhost", "irishsto_derp", "irishsto") or die(mysql_error());
  8. // mysql_select_db("irishsto_blog") or die(mysql_error());
  9.  
  10. mysql_connect("localhost", "root", "") or die(mysql_error());
  11. mysql_select_db("jamiegrant_blog") or die(mysql_error());
  12. ?>
  13.  
  14. <body class="body">
  15.  
  16. <div id="wrappernews"><!--Opens Wrapper DIV-->
  17. <div id="bannernews"></div>
  18.  
  19. <div id="navigation">
  20. <ul id="nav">
  21. <li><a href="index.html">Home</a></li>
  22. <li><a href="news.html">News</a></li>
  23. <li><a href="game.html">Game</a></li>
  24. <li><a href="art.html">Art</a></li>
  25. <li><a href="contacts.html">Contact</a></li>
  26. </ul>
  27. </div>
  28.  
  29. <div id="navigationagain">
  30. <ul id="nav">
  31. <li><a href="leveldesign.html">LevelDesign</a></li>
  32. <li><a href="renders.html">Renders</a></li>
  33. </ul>
  34. </div>
  35. <!--/////////////////////////////////////////////////// -->
  36.  
  37. <!--///////////////////////////////////////////////////-->
  38. <div id="news">
  39. <?php
  40.  
  41. // Select all from myblog in decending order of id
  42. $sql = mysql_query("SELECT * FROM myblog ORDER BY id DESC");
  43.  
  44. while($row = mysql_fetch_array($sql))
  45. {
  46.  
  47. $title = $row['headline'];
  48. $article = $row['smalltext'];
  49. $author = $row['author'];
  50. $date = $row['date'];
  51. $id = $row['id'];
  52.  
  53.  
  54. echo "<Strong> $title </Strong>";
  55.  
  56. echo "<br />";
  57. echo $article;
  58.  
  59. echo "<br />";
  60. echo "Posted by<Strong> $author</Strong> on the <Strong>$date</Strong>";
  61.  
  62. echo "<br />";
  63. echo "<br />";
  64. }
  65. ?>
  66.  
  67. </div>
  68. </div>
  69. <!--Closes Wrapper DIV-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement