Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/08/2007, 20:02
Avatar de pzin
pzin
Moderata 😈
 
Fecha de Ingreso: julio-2002
Ubicación: Islas Canarias
Mensajes: 10.488
Antigüedad: 21 años, 9 meses
Puntos: 2114
Re: Mensaje por tabla ** ayuuudaa

Para que no se junten, aunque lo mejor es usar CSS para ello, puedes poner al final del bucle dos saltos de linea (<br>).

Para mostrar solo un registro, quita el while y añade un where a tu consulta sql.

Código PHP:
<html>
<head>
<title>Php</title>
</head>
<body>
<div align="center">
<h1>Lectura de registros</h1>
<?
//Conexion con la bd
mysql_connect("localhost","propiedades","mipassprivado");

//seleccion de la bd con la que vamos a trabajar
 
mysql_select_db("propiedades");
 
//Ejecucion de la sentencia sql
$result mysql_query ("select * from propiedades where codigo='150b'");
?>
<?
//mostramos el registro
$row mysql_fetch_array($result);
echo 
"<table bgColor='#FFFFD2' align='center'>";
echo 
"<tr align='center'> <td> Código:  ".$row["codigo"]."</td>";
echo 
"</tr>";
echo 
"<td align='center'> Tipo:  ".$row["tipo"]."</td>";
echo 
"</tr>";
echo 
"<td align='center'> Operación:  ".$row["operacion"]."</td>";
echo 
"</tr>";
echo 
"<td align='center'> Precio:  ".$row["precio"]."</td>";
echo 
"</tr>";
echo 
"<td align='center'> Descripción:  ".$row["descripcion"]."</td> </tr>";
echo 
"</table>";
?>
</table>
<p></p>
<p></p>
</div>
</body>
</html>