Ver Mensaje Individual
  #15 (permalink)  
Antiguo 30/04/2010, 12:12
cher1_7
(Desactivado)
 
Fecha de Ingreso: junio-2008
Mensajes: 287
Antigüedad: 15 años, 10 meses
Puntos: 9
Respuesta: tengo un problemilla al recoger datos de una bd desde un linck

aqui es donde me atoro, mostrar los datos de cada usuario, este es el codigo que utilizo para mostrarlos pero me coloca los datos de todos los usuarios
dejo la web para que lo cheques
http://www.chicharrines.net/index1/datos/

Código PHP:
<?php
$conexion 
mysql_connect("localhost""xxxxxxxxx""xxxxxxxxx");
mysql_select_db("xxxxxxxxxxxxx"$conexion);

$queEmp "SELECT * FROM registro_usuarios ORDER BY username ASC";
$resEmp mysql_query($queEmp$conexion) or die(mysql_error());
$totEmp mysql_num_rows($resEmp);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>mostrar perfil</title>
<style type="text/css">
<!--
body {
    font-family: "Trebuchet MS", Tahoma, Verdana;
    font-size: 12px;
    font-weight: normal;
    color: #666666;
    text-decoration: none;
    padding: 20px;
}
h4 {
    color: #CC0000;
}
-->
</style>
</head>
<body>
<?php 
if ($totEmp0) {
    while (
$rowEmp mysql_fetch_assoc($resEmp)) {
        echo 
"usuario: <strong>".$rowEmp['username']."</strong><br></br>";
        echo 
"email: ".$rowEmp['email']."<br></br>";
        echo 
"identificacion: ".$rowEmp['ID']."<br></br>";
        echo 
"dia nacimiento: ".$rowEmp['dianac']."<br></br>";
    
    }
}
?>
</body>
</html>
Cita:
Iniciado por EUSKARA Ver Mensaje
me doy cuenta de que :

Código PHP:
Ver original
  1. <?php  
  2. if ($totEmp> 0) {
  3.     while ($rowEmp = mysql_fetch_assoc($resEmp)) {
  4.         echo '<a href=perfil.php?s_username='.$rowEmp['username'].'>'.$rowEmp['username'].'</a><br />';    
  5.     }
  6. }
  7. ?>

concatenas por ke no lo dejas :

Código PHP:
Ver original
  1. <?php  
  2. if ($totEmp> 0) {
  3.     while ($rowEmp = mysql_fetch_assoc($resEmp)) {
  4.         echo '<a href="perfil.php?s_username=<?php echo $rowEmp['username']>"><?php echo $rowEmp['username'];?></a><br />';    
  5.     }
  6. }
  7.  
  8. ?>