Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //connect to db
- $link = mysql_connect('localhost','root','password') or die (mysql_error());
- $db = mysql_select_db('used_cars') or die (mysql_error());
- //var_dump($db);
- $result = mysql_query ("SELECT * FROM cars");
- while ($row = mysql_fetch_row($result)){
- echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
- <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
- <head>
- <meta http-equiv='content-type' content='text/html; charset=utf-8' />
- <meta name='author' content='owner' />
- <link rel='stylesheet' type='text/css' href='display_car.css' />
- <title>Untitled 2</title>
- </head>";
- echo "<body>
- <div id='carswrapper'>
- <font id='carsfonttop'>$row[1] $row[2] $row[3] </font>
- <div id='carsinnerwrapper'>
- <img src='http://localhost/add_car/uploaded_files/$row[11]' alt='Smiley face' height='100' width='150' />
- <div class='carsc1'>
- Engine:<br />
- Transmission:<br />
- Drivetrain:<br />
- Mileage:<br />
- </div>
- <div class='carsc2'>
- $row[4]<br />
- $row[5]<br />
- $row[6]<br />
- $row[9]
- </div>
- <div class='carsc1'>
- Ext. Color:<br />
- Int. Color:<br />
- Vin #: <br />
- Price: <br />
- </div>
- <div class='carsc2'>
- $row[7]<br />
- $row[8]<br />
- $row[10]
- $row[12]
- </div>
- </div>
- <font id='carsfontbottom'></font>
- </div><br />";
- }
- mysql_close($link);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment