Advertisement
vencinachev

CarsFile

Dec 21st, 2020
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Cars project</title>
  5.     <style>
  6. #customers {
  7.   font-family: Arial, Helvetica, sans-serif;
  8.   border-collapse: collapse;
  9.   width: 100%;
  10. }
  11.  
  12. #customers td, #customers th {
  13.   border: 1px solid #ddd;
  14.   padding: 8px;
  15. }
  16.  
  17. #customers tr:nth-child(even){background-color: #f2f2f2;}
  18.  
  19. #customers tr:hover {background-color: #ddd;}
  20.  
  21. #customers th {
  22.   padding-top: 12px;
  23.   padding-bottom: 12px;
  24.   text-align: left;
  25.   background-color: #ff9933;
  26.   color: white;
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <h1>Автомобили</h1>
  32.  
  33. <table id="customers" border="1">
  34. <tr>
  35.     <th>Марка и модел</th>
  36.     <th>Описание</th>
  37.     <th>Пробег</th>
  38.     <th>Снимка</th>
  39. </tr>
  40. <?php
  41.     include("dbconnect.php");
  42.     $stmt = $pdo->query("SELECT * FROM cars");
  43.    
  44.     while($row = $stmt->fetch()){
  45.         echo "<tr>";
  46.         echo "<td>".$row["Make"]."</td>";
  47.         echo "<td>".$row["Description"]."</td>";
  48.         echo "<td>".$row["Milage"]."</td>";
  49.         echo "<td align='center'><img src='".$row["ImageLink"]."' width=220px height=150px></td>";
  50.         echo "</tr>";
  51.     }
  52. ?>
  53. </table>
  54. </table>
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement