Advertisement
Guest User

PHP

a guest
May 26th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL & ~ E_NOTICE);
  3.  
  4. include("config.php");
  5. $link_sg = mysql_connect($dbhost, $dbuser, $dbpass) or die('Could not connect: ' . mysql_error());
  6. include("playername.php");
  7. mysql_select_db($mysql_db) or die('Could not select database (Chat Verlauf)');
  8.  
  9.  
  10. $query = "SELECT * FROM `lb-chat` ORDER BY DATE";
  11. $result = mysql_query($query) or die('Query failed: ' . mysql_error());
  12.  
  13. echo "<table id='stats_sg' class='table'>";
  14. echo "<thead>";
  15. echo"".$name."";
  16. echo "</thead>";
  17. $RANK = 0;
  18. while ($line = mysql_fetch_array($result, MYSQL_ASSOC)){
  19. $RANK = $RANK+1;
  20.  
  21.  
  22. $id = $line['id'];
  23. $playerid1 = $line['playerid'];
  24. $date = $line['date'];
  25. $message = $line['message'];
  26.  
  27.  
  28.  
  29.  
  30. echo "<tbody>";
  31. if ($RANK == 1)
  32. {
  33. echo "<tr class='first' height='41px'>";
  34. echo "<td>".$id.".</td>";
  35.  
  36. echo "<td>".$playerid1."</td>";
  37.  
  38. echo "<td>".$date."</td>";
  39.  
  40. echo "<td>".$message."</td>";
  41.  
  42.  
  43. echo "</tr>";
  44. }else if ($RANK == 2)
  45. {
  46. echo "<tr class='second' height='41px'>";
  47. echo "<td>".$id.".</td>";
  48.  
  49. echo "<td>".$playerid1."</td>";
  50.  
  51. echo "<td>".$date."</td>";
  52.  
  53. echo "<td>".$message."</td>";
  54.  
  55.  
  56. echo "</tr>";
  57. }else if ($RANK == 3)
  58. {
  59. echo "<tr class='third' height='41px'>";
  60. echo "<b><td>".$id.".</td></b>";
  61.  
  62. echo "<td>".$playerid1."</td>";
  63.  
  64. echo "<td>".$date."</td>";
  65.  
  66. echo "<td>".$message."</td>";
  67.  
  68.  
  69. echo "</tr>";
  70. }else{
  71. echo "<tr height='41px'>";
  72. echo "<td>".$id.".</td>";
  73.  
  74. echo "<td>".$playerid1."</td>";
  75.  
  76. echo "<td>".$date."</td>";
  77.  
  78. echo "<td>".$message."</td>";
  79.  
  80.  
  81. echo "</tr>";
  82. }
  83. echo "</tbody>";
  84.  
  85. }
  86. echo "</table>";
  87.  
  88. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement