Código PHP:
<?php
$conexion = mysql_connect('localhost', 'l', '');
mysql_select_db('concesionaria');
?>
<head>
<title>Concesionaria - Venta y Compra de Vehiculos</title>
<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
</head>
<body>
<div id="outer">
<div id="wrapper">
<div id="body-bot">
<div id="body-top">
<div id="logo">
<h1>CONCESIONARIA</h1>
<p>Venta y Compra de Vehiculos</p>
</div>
<div id="nav">
<ul>
<li><a href="index.php">INICIO</a></li>
<li><a href="marca.php">BUSCAR MARCA</a></li>
<li><a href="modelo.php">BUSCAR MODELO</a></li>
<li><a href="empresa.php">LA EMPRESA</a></li>
<li><a href="contacto.php">CONTACTO</a></li>
</ul>
<div class="clear"> </div>
</div>
<table width="" height="40" border="1" align="center">
<tr><td width="237" height="25"></td>
</tr>
<tr><td height="35">BUQUEDA POR MARCA</td>
<td width="238" height="35">BUQUEDA POR MODELO</td>
</tr>
</table>
<?php //Esto es lo que devuelve segun los datos de la tabla de arriba
$sql = "SELECT DISTINCT coches.*, marcas.* FROM coches, marcas WHERE coches.idMarca = marcas.id";
if (intval($_POST['selCiudad']) > 0) {
$sql .= " AND coches.idMarca = '" . intval($_POST['selCiudad']) . "'";
}
$sql .= " ORDER BY marcas.marca DESC";
$tabla = mysql_query($sql);
while ($registro = mysql_fetch_array($tabla)) {
?>
<table border="1" width="700" align="center">
<tr>
<td>Marca</td>
<td><?php echo $registro['Marca']; ?></td>
</tr>
<tr>
<td>Modelo</td>
<td><?php echo $registro['Modelo']; ?></td>
</tr>
<tr>
<td>Precio</td>
<td><?php echo $registro['Precio']; ?></td>
</tr>
<tr>
<td>Año</td>
<td><?php echo $registro['Ano']; ?></td>
</tr>
<tr>
<td>Kilometraje</td>
<td><?php echo $registro['Kms']; ?></td>
</tr>
<tr>
<td><?php echo '<img src="img/'.$registro["imagen"].'" width="56" height="42" >'; ?></td>
</tr>
</table>
<?php
}
mysql_free_result($tabla);
mysql_close($conexion);
?>
</div>
</div>
</div>
</div>
</body>
</html>