Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Cars project</title>
- <style>
- #customers {
- font-family: Arial, Helvetica, sans-serif;
- border-collapse: collapse;
- width: 100%;
- }
- #customers td, #customers th {
- border: 1px solid #ddd;
- padding: 8px;
- }
- #customers tr:nth-child(even){background-color: #f2f2f2;}
- #customers tr:hover {background-color: #ddd;}
- #customers th {
- padding-top: 12px;
- padding-bottom: 12px;
- text-align: left;
- background-color: #ff9933;
- color: white;
- }
- </style>
- </head>
- <body>
- <h1>Автомобили</h1>
- <table id="customers" border="1">
- <tr>
- <th>Марка и модел</th>
- <th>Описание</th>
- <th>Пробег</th>
- <th>Снимка</th>
- </tr>
- <?php
- include("dbconnect.php");
- $stmt = $pdo->query("SELECT * FROM cars");
- while($row = $stmt->fetch()){
- echo "<tr>";
- echo "<td>".$row["Make"]."</td>";
- echo "<td>".$row["Description"]."</td>";
- echo "<td>".$row["Milage"]."</td>";
- echo "<td align='center'><img src='".$row["ImageLink"]."' width=220px height=150px></td>";
- echo "</tr>";
- }
- ?>
- </table>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement