
08/03/2011, 11:10
|
| | Fecha de Ingreso: febrero-2011 Ubicación: Madrid
Mensajes: 9
Antigüedad: 14 años Puntos: 0 | |
Respuesta: ayuda con id que recibimos de otra página Hola perdona pero he tenido ciertos problemillas y no he podido hacer nada, te cuento el fallo lo tengo que tener en la página a la que llamo ya que no me muestra nada, si paso el mouse por encima si me aparece la página con el id correspondiente
Vuelvo a poner el nuevo código este es donde saco todos los registros
$ocasion=mysql_query("SELECT `inmuebles`.`ID_INMUEBLE`,`fotos`.`FOTO` ,`inmuebles`.`PROVINCIA` , `inmuebles`.`POBLACION` , `inmuebles`.`TIPO` , `inmuebles`.`INMUEBLE` , `inmuebles`.`METROS` , `inmuebles`.`PRECIO` , `inmuebles`.`VER`\n"
. "FROM fotos, inmuebles\n"
. "where `fotos`.`ID_INMUEBLE`=`inmuebles`.`ID_INMUEBLE`\n"
. "and `inmuebles`.`OCASION`='Si'");
?>
<table width="800" align="center">
<tr>
<th class="Estilo8"></th>
<th class="Estilo8">Provincia</th>
<th class="Estilo8">Población</th>
<th class="Estilo8">Tipo</th>
<th class="Estilo8">Inmueble</th>
<th class="Estilo8">Metros</th>
<th class="Estilo8">Precio/€</th>
</tr>
<?php
//mostramos los registros
if(mysql_num_rows($ocasion) == '0')
{
echo '<th>'."";
echo '<th>'."No hay resultados";
echo '<th>'."No hay resultados";
echo '<th>'."No hay resultados";
echo '<th>'."No hay resultados";
echo '<th>'."No hay resultados";
echo '<th>'."No hay resultados";
}else
while ($row=mysql_fetch_array($ocasion))
{echo '<tr><th><img src="/web/imagweb/'.$row["FOTO"].'">';
echo '<th>'.$row["PROVINCIA"];
echo '<th>'.$row["POBLACION"];
echo '<th>'.$row["TIPO"];
echo '<th>'.$row["INMUEBLE"];
echo '<th>'.$row["METROS"]=number_format($row["METROS"],0,'.','.');
echo '<th>'.$row["PRECIO"]=number_format($row["PRECIO"],0,'.','.');?>
<th><a href="<?php echo "detalles.php?ID_INMUEBLE=".$row["ID_INMUEBLE"]; ?>">Ver</a>
<?PHP
}
mysql_free_result($ocasion)
?>
Y esta es donde llamo para mostrar los registros del id que pinche:
<? $ID_INMUEBLE=$_GET['ID_INMUEBLE'];
$ocasion=mysql_query("SELECT `inmuebles`.`ID_INMUEBLE`,`fotos`.`FOTO` ,`inmuebles`.`PROVINCIA` , `inmuebles`.`POBLACION` , `inmuebles`.`TIPO` , `inmuebles`.`INMUEBLE` , `inmuebles`.`METROS` , `inmuebles`.`PRECIO` , `inmuebles`.`VER`\n"
. "FROM fotos, inmuebles\n"
. "where `fotos`.`ID_INMUEBLE`=`inmuebles`.`ID_INMUEBLE`\n"
. "and `inmuebles`.`ID_INMUEBLE`=`$ID_INMUEBLE`"
. "and `inmuebles`.`OCASION`='Si'");
$row=mysql_fetch_array($ocasion);?>
<table>
<td>FOTO</td><td><?echo $row['FOTO']?></td>
<td>PROVINCIA</td><td><?echo $row['PROVINCIA']?></td>
<td>POBLACION</td><td><?echo $row['POBLACION']?></td>
<td>TIPO</td><td><?echo $row['TIPO']?></td>
<td>INMUEBLE</td><td><?echo $row['INMUEBLE']?></td>
<td>METROS</td><td><?echo $row['METROS']?></td>
<td>PRECIO</td><td><?echo $row['PRECIO']?></td>
</table>
Última edición por cendios; 13/03/2011 a las 11:39 |