PHP - aYuda al moStrar datos de data base

 
Vista:

aYuda al moStrar datos de data base

Publicado por skirlappa (1 intervención) el 08/12/2005 12:58:23
Hola

Tengo el siguiente problema al entrar en esta pagina:

212.79.158.229/webware/agencia.php y pinchar en un campo no me muestra exclusivamente el campo que has pinchado sino que me lista todo lo que esta en la base de datos, el codigo es el siguiente

Agencia.php:


<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<?
$bd="********";
$tabla="****";
$c=mysql_connect("*l****","*****");
mysql_select_db($bd,$c);
$resultado=mysql_query("SELECT * FROM $tabla",$c);
?>
<p align="center"><font color="#FF0000" size="6"><strong><em>Códigos (la prueba)</em></strong></font></p>
<div align="center">
<table width="67%" height="55" border="1">
<tr>
<td width="19%"><div align="center"><font color="#0000FF" size="4"><strong><em>Nombre</em></strong></font></div></td>
</tr>
<?
while ($registro=mysql_fetch_row($resultado))
{
?>
<tr>
<td height="22"><div align="center"><a href="agencia1.php?id=<? echo $registro[0]; ?>"><strong><font color="#000000" size="3"><em><? echo $registro[1]; ?></em></font></strong></a></div></td>
</tr>
<?
}
?>
</table>
</div>
<p> </p>
<p> </p>
<? mysql_close();?>
</body>

Agencia1.php:


<?
$bd="********";
$tabla="*********";
$c=mysql_connect("*********","*****");
mysql_select_db($bd,$c);
$id = $_GET['id'];
$resultado=mysql_query("SELECT * FROM $tabla WHERE $id ",$c);

?>
<p align="center"><font color="#FF0000" size="6"><strong><em>Codigos muestra </em></strong></font></p>
<div align="center">
<table width="67%" height="99" border="1">
<tr>
<td width="19%"><div align="center"><font color="#0000FF" size="4"><strong><em>Nombre</em></strong></font></div></td>
<td width="24%"><div align="center"><font color="#0000FF" size="4"><strong><em>Codigo</em></strong></font></div></td>
</tr>
<?
while ($registro=mysql_fetch_row($resultado))
{
?>
<tr>
<td height="68"><div align="center"><strong><font color="#000000" size="3"><em><?echo $registro[1];?></em></font></strong></a></div></td>
<td><div align="center"><strong><font size="4"><em><?echo $registro[2];?></em></font></strong></a><font size="4"><em></em></font></div></td>
</tr>
<?
}
?>
</table>
</div>
<p> </p>
<p> </p>
<? mysql_close();?>
</body>

</body>


QUE ES LO QUE ME FALLA??? PARA QUE ME MUESTRE EL RESULTADO SOLO DEL CAMPO AL QUE PICAS???
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:aYuda al moStrar datos de data base

Publicado por eduardo (1 intervención) el 09/12/2005 00:01:49
A mi me pasa lo mismo!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar