Advertisement
Guest User

Untitled

a guest
Jul 14th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. $hostname = "localhost";
  2. $username = "******";
  3. $password = "*******";
  4. $dbname = "*****";
  5. $usertable= "*******";
  6.  
  7.  
  8. $con = mysqli_connect ($hostname, $username, $password, $dbname);
  9. $sql="SELECT * FROM $usertable";
  10. $result=mysqli_query($con,$sql);
  11. $row = mysqli_fetch_array($result);
  12. if (mysqli_connect_errno()) {
  13. echo "failed".mysqli_connect_error();
  14. }
  15. else {
  16. while($row != null) {
  17.  
  18. $id = $row["ID"];
  19. $name = $row["post_name"];
  20. $content = $row["post_content"];
  21. $date = $row["post_date"];
  22. $link = $row["post_link"];
  23. echo '<div id="outer", class="border">'.
  24. '<div class="inner", style="background-image:url('.
  25. $name.');border-right:1px solid #ff6666"></div>'.
  26. '<div class="inner", style="width:69%;">'.
  27. $date.$content.'<a href="'.$link.'"><bold>here</bold></a>'.
  28. '</div></div>';
  29. }
  30. }
  31. mysqli_close($con);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement