Ver Mensaje Individual
  #6 (permalink)  
Antiguo 12/12/2010, 21:25
Avatar de soy_nicanor
soy_nicanor
 
Fecha de Ingreso: mayo-2010
Mensajes: 374
Antigüedad: 14 años
Puntos: 3
Respuesta: Ayuda urgente por favor

No me funcioa

Código PHP:
Ver original
  1. <?php
  2. include('busqueda.php');
  3. $link = mysql_connect("localhost", "root", "root");
  4. mysql_select_db("sistema_de_pacientes", $link);
  5. $result = mysql_query("SELECT * FROM nombre_codigo WHERE nombres LIKE '%$buscar%' ORDER BY nombres", $link);
  6. if ($row = mysql_fetch_array($result))
  7. {
  8. $_SESSION["codigo"]=$row["codigo"];
  9. echo '<table width="400" cellspacing="0" cellpadding="3" align="center"';
  10. //Mostramos los nombres de las tablas
  11. echo "<tr>";
  12. echo "<td>"."<strong>CODIGO</strong>"."</td>";
  13. echo "<td>"."<strong>NOMBRE</strong>"."</td>";
  14. echo "<td>"."<strong>APELLIDOS</strong>"."</td>";
  15. echo "<td>"."<strong>DNI</strong>"."</td>";
  16. echo "</tr>";
  17. do {
  18.             echo "<tr>";
  19.             echo '<td><a href="cliente.php?='.$row["codigo"].'?"><font size="2" color="#0000FF">'.$row["codigo"].'</a></font></td>';
  20.             echo "<td>".$row["nombres"]."</td>";
  21.             echo "<td>".$row["apellidos"]."</td>";  
  22.             echo "<td>".$row["dni"]."</td>";
  23.             echo "</tr>";
  24.     } while ($row = mysql_fetch_array($result));
  25. echo "</table>";
  26. }
  27. else
  28. {
  29. echo "¡ No se ha encontrado ningún registro !";
  30. }
  31. ?>

y `pasa ha esto cliente.php

Código PHP:
Ver original
  1. <?
  2. $link = mysql_connect("localhost", "root", "root");
  3.     mysql_select_db("sistema_de_pacientes", $link);
  4.    
  5. $codigo = $_GET['codigo'];
  6. $query = mysql_query("SELECT * FROM datos_paciente WHERE codigo='$codigo'") or die (mysql_error());
  7. $result = mysql_query($query);   
  8. echo '<table width="400" cellspacing="0" cellpadding="3" align="center"';
  9. //Mostramos los nombres de las tablas
  10. echo "<tr>";
  11. echo "<td>"."<strong>CODIGO</strong>"."</td>";
  12. echo "</tr>";
  13. do {
  14.             echo "<tr>";  
  15.             echo "<td>".$row["email"]."</td>";
  16.             echo "</tr>";
  17.     } while ($row = mysql_fetch_array($result));
  18. echo "</table>";
  19.      ?>

en que estoy mal

Última edición por soy_nicanor; 12/12/2010 a las 21:45