Ver Mensaje Individual
  #22 (permalink)  
Antiguo 30/04/2010, 14:38
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

cambie el codigo de s_username a solo username
aqui muestro cuantos usuarios hay en la base de datos y los muestro con el link del usuario hacia perfil.php estoy !desarrollando con dreamweaver!

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

$queEmp "SELECT * FROM registro_usuarios ORDER BY username";
$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 datos</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 
'<a href=perfil.php?username='.$rowEmp['username'].'>'.$rowEmp['username'].'</a><br />';    
    }
}
?>
</body>
</html>
este es perfil.php, aqui muestro los datos

Código PHP:
<?php
//entramos a la base de datos
$conexion mysql_connect("localhost""xxxxxx""xxxxxxx");
mysql_select_db("xxxxxxxxx"$conexion);

$queEmp "SELECT * FROM registro_usuarios WHERE username = ".$_GET['username']." ORDER BY username";
$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>
pero me marca este error pero el usuario si existe en la bd

Cita:
Unknown column 'pinky' in 'where clause'