Advertisement
Guest User

teams.php

a guest
May 14th, 2019
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include('nav.inc.php');
  4. $dbservername = "localhost";
  5. $dbusername = "root";
  6. $dbpassword = "";
  7. $db = new PDO("mysql:host=$dbservername;dbname=football", $dbusername, $dbpassword);
  8. $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  9. ?>
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <title>Fußball</title>
  14. <link type="text/css" rel="stylesheet" href="style.css">
  15. </head>
  16. <body>
  17.  
  18. <br>
  19. <h1 align="center">European Clubs</h1>
  20. <h3>Table of the best clubs in the world</h3>
  21. <h5>This table is sorted according to the fifa points of the clubs.</h5><br><br>
  22. <?php
  23. $sql2 ="SELECT id, name, leauge, points, image, imagepath from teams order by points desc";
  24. $stmt2 = $db->prepare($sql2);
  25. $stmt2->execute();
  26.  
  27. echo'
  28. <table align="center" border="1">
  29. <tr class="rowhead" align="center" style="font-size:16px" bgcolor="#003399">
  30. <th width="70"></th>
  31. <th width="250">TEAMS</th>
  32. <th width="250">LEAGUE</th>
  33. <th width="90">POINTS</th>
  34. </tr>
  35.  
  36. ';
  37.  
  38.  
  39. while($row = $stmt2->fetch()){
  40.  
  41. echo'<tr><td bgcolor="#FFFFFF" align="center" height=50>';
  42. echo "<img src='images/".$row['image']."' height=35>";
  43. echo"</td>";
  44.  
  45. echo'<td style="color:black;" bgcolor="#C6C6C6" align="center">';
  46. echo $row['name'];
  47. echo"</td>";
  48.  
  49. echo'<td style="color:black;" bgcolor="#FFFFFF" align="center">';
  50. echo $row['leauge'];
  51. echo"</td>";
  52.  
  53. echo'<td style="color:black;" bgcolor="#C6C6C6" align="center">';
  54. echo $row['points'];
  55. echo"</td></tr>";
  56.  
  57. }
  58. echo"</table>";
  59.  
  60. ?>
  61. <footer>
  62. <h2>Champions League in numbers</h2>
  63. <br>
  64. <table>
  65. <tr class="footerhead">
  66. <td width="300">Average goal per game</td>
  67. <td width="300">Goals</td>
  68. <td width="300">Completed games</td>
  69. <td width="300">Top goalscorer</td>
  70. </tr>
  71.  
  72. <tr class="footercontent" height="50">
  73. <td style="font-size:25px"><b>2,94 </b><img src="images/fußball.jpeg" height="20"><img src="images/fußball.jpeg" height="20"><img src="images/fußball.jpeg" height="20"></td>
  74. <td style="font-size:25px"><b>364</b></td>
  75. <td style="font-size:25px"><b>124</b></td>
  76. <td style="font-size:25px">Lionel Messi</td>
  77. </tr>
  78. </table>
  79.  
  80. </footer>
  81. </body>
  82. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement