Ver Mensaje Individual
  #6 (permalink)  
Antiguo 21/11/2011, 09:29
bbrian
 
Fecha de Ingreso: enero-2010
Mensajes: 400
Antigüedad: 15 años
Puntos: 6
Respuesta: Busqueda por id en php

Me carga en el mismo lugar donde pones el codigo, debajo del formulario.
agregandole esto logicamente.
Código PHP:
 <?php
$sql 
"SELECT propiedades.*, ciudades.* FROM propiedades, ciudades WHERE propiedades.idciudad = ciudades.id ";
if (isset(
$_POST['txtBusqueda'])) {
    
$sql .= " AND propiedades.titulo LIKE '%" $_POST['txtBusqueda'] . "%' ";
    if (
intval($_POST['selCiudad']) > 0) {
        
$sql .= " AND propiedades.idciudad = '" intval($_POST['selCiudad']) . "'";
    }
}
$sql .= " ORDER BY ciudades.nombre DESC";
$tabla mysql_query($sql);
while (
$registro mysql_fetch_array($tabla)) {
?>

  <tr>
        <td height="82" class="Estilo1"><span class="Estilo9"><?php echo $registro['id']; ?></span></td>
    <td class="Estilo1"><span class="Estilo9"><?php echo $registro['titulo']; ?></span></td>
    <td class="Estilo9"><?php echo $registro['idciudad']; ?><?php echo $registro['nombre']; ?></td>
    <td class="Estilo1"><span class="Estilo9"><?php echo $registro['descripcion']; ?></span></td>
    <td class="Estilo9">Venta: <?php echo $registro['precioventa']; ?> / Renta: <?php echo $registro['preciorenta']; ?></td>
    </tr>

Modifica con los datos de tus tablas