Ver Mensaje Individual
  #18 (permalink)  
Antiguo 30/04/2010, 13:08
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

ijole aqui ya me la pusiste mas dificil, no me podrias ayudar con el otro codigo?


Cita:
Iniciado por EUSKARA Ver Mensaje
listo men sip mira el problema esta en el php perfil en el cual tu lo pones normal sin aser nada de restricciones vale;
en este es donde vas a rescatar todos los datos de un solo usuario como lo ases asi mira:
Código HTML:
Ver original
  1. <?php require_once('tuConeccion'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7.  
  8.  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  9.  
  10.  switch ($theType) {
  11.    case "text":
  12.      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  13.      break;    
  14.    case "long":
  15.    case "int":
  16.      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  17.      break;
  18.    case "double":
  19.      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  20.      break;
  21.    case "date":
  22.      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  23.      break;
  24.    case "defined":
  25.      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  26.      break;
  27.  }
  28.  return $theValue;
  29. }
  30. }
  31.  
  32. $colname_Usuario = "-1";
  33. if (isset($_GET['s_username'])) {
  34.  $colname_Usuario = $_GET['s_username'];
  35. }
  36. mysql_select_db($database_tuBD, $tuBD);
  37. $query_Usuario = sprintf("SELECT Usuario, Password, Correo FROM usuarios WHERE Usuario = %s", GetSQLValueString($colname_Usuario, "text"));
  38. $Usuario = mysql_query($query_Usuario, $tuBD) or die(mysql_error());
  39. $row_Usuario = mysql_fetch_assoc($Usuario);
  40. $totalRows_Usuario = mysql_num_rows($Usuario);
  41. ?><html>
  42. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  43. <title>mostrar perfil</title>
  44. <style type="text/css">
  45. <!--
  46. body {
  47.     font-family: "Trebuchet MS", Tahoma, Verdana;
  48.     font-size: 12px;
  49.     font-weight: normal;
  50.     color: #666666;
  51.     text-decoration: none;
  52.     padding: 20px;
  53. }
  54. h4 {
  55.     color: #CC0000;
  56. }
  57. -->
  58. </head>
  59. <p>usuario : <?php echo $row_Usuario['Usuario']; ?></p>
  60. <p>correo: <?php echo $row_Usuario['Correo']; ?></p>
  61. <p>pass: <?php echo $row_Usuario['Password']; ?></p>
  62. <p>&nbsp;</p>
  63. <p>etc...<br>
  64. </p>
  65. </br></body>
  66. </html>
  67. <?php
  68. mysql_free_result($Usuario);
  69. ?>
acuerdate de cambiar el conection de este "tuBD" a como se llame la tuya si no no funcionara checa el codigo y donde veas eso cambialo ala tuya

EDITO:

en la primera linea es tu coneccion no la BD :p