Advertisement
vencinachev

SelectCars

Dec 17th, 2020
1,160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <?php
  2. include('dbconnect.php');
  3.  
  4. $stmt = $pdo->query('SELECT * FROM cars');
  5.  
  6. echo "<table border='1'>";
  7. echo "<tr>";
  8. echo "<td><b>Make</b></td>";
  9. echo "<td><b>Model</b></td>";
  10. echo "<td><b>Description</b></td>";
  11. echo "<td><b>Milage</b></td>";
  12. echo "</tr>";
  13. while ($row = $stmt->fetch()) {
  14.     echo "<tr>";
  15.     echo "<td>".$row['Make'] . "</td>";
  16.     echo "<td>".$row['Model'] . "</td>";
  17.     echo "<td>".$row['Description'] . "</td>";
  18.     echo "<td>".$row['Milage'] . "</td>";
  19.     echo "</tr>";
  20. }
  21. echo "</table>";
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement