Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 18th, 2013  |  syntax: None  |  size: 0.44 KB  |  views: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. $dbhost = 'localhost';
  4.  
  5. $user = 'root';
  6.  
  7. $password = 'root';
  8.  
  9. $dbname = 'inventory';
  10.  
  11. $pdo = new PDO("mysql:host=$dbhost; $dbname", $user, $password);
  12.  
  13.  
  14. ?>
  15.  
  16. <html>
  17. <head>
  18. <title>Inventory List</title>
  19. </head>
  20. <body>
  21. <?php
  22.         include 'inventory.php';
  23.        
  24. $list = $pdo->query("SELECT year, make, model, color, price FROM cars ORDER BY price ASC");
  25.  
  26. $results = $list->fetchAll(PDO::FETCH_OBJ);
  27. ?>
  28.  
  29.  
  30.  
  31.  
  32. </body>
  33. </html>