Guest User

display_cars1

a guest
Jun 27th, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. //connect to db
  2. $link = mysql_connect('localhost','root','password') or die (mysql_error());
  3. $db = mysql_select_db('used_cars') or die (mysql_error());
  4. //var_dump($db);
  5.  
  6. $result = mysql_query ("SELECT * FROM cars");
  7. while ($row = mysql_fetch_row($result)){
  8.  
  9.  
  10. echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
  11. <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
  12.  
  13. <head>
  14. <meta http-equiv='content-type' content='text/html; charset=utf-8' />
  15. <meta name='author' content='owner' />
  16. <link rel='stylesheet' type='text/css' href='display_car.css' />
  17. <title>Untitled 2</title>
  18. </head>";
  19.  
  20. echo "<body>
  21. <div id='carswrapper'>
  22.  
  23. <font id='carsfonttop'>$row[1] $row[2] $row[3] </font>
  24. <div id='carsinnerwrapper'>
  25. <img src='http://localhost/add_car/uploaded_files/$row[11]' alt='Smiley face' height='100' width='150' />
  26. <div class='carsc1'>
  27. Engine:<br />
  28. Transmission:<br />
  29. Drivetrain:<br />
  30. Mileage:<br />
  31. </div>
  32. <div class='carsc2'>
  33. $row[4]<br />
  34. $row[5]<br />
  35. $row[6]<br />
  36. $row[9]
  37. </div>
  38. <div class='carsc1'>
  39. Ext. Color:<br />
  40. Int. Color:<br />
  41. Vin #: <br />
  42. Price: <br />
  43. </div>
  44. <div class='carsc2'>
  45. $row[7]<br />
  46. $row[8]<br />
  47. $row[10]
  48. $row[12]
  49. </div>
  50. </div>
  51. <font id='carsfontbottom'></font>
  52. </div><br />";
  53. }
  54. mysql_close($link);
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment