• Viernes 18 de Octubre de 2024, 19:21

Autor Tema:  No Funciona Buscador??????  (Leído 884 veces)

neorent

  • Miembro MUY activo
  • ***
  • Mensajes: 249
    • Ver Perfil
    • http://www.laestokada.cl
No Funciona Buscador??????
« en: Lunes 11 de Septiembre de 2006, 20:02 »
0
hola amigos del foro, bueno aqui con otro problema, estoy haciendo una buscador exacto y no me funciona segun yo el code esta ok pero no se que pasa, bueno les dejo el code para me digan si hay algo malo en el o definitivamente esta malo mi pc, gracias

bueno este es el formulario donde paso el valor al buscar
se llama fbusqueda.php

Código: Text
  1.  
  2. <html>
  3. <head>
  4. <title>Solicitudes de mantención</title>
  5. </head>
  6. <style type="text/css">
  7. <!--
  8. .style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
  9. .style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
  10. -->
  11. </style>
  12. <body>
  13. <?php include("formato.php"); ?>
  14. <?php CabeceraPagina(); ?>
  15. <h3>Buscar Solicitud </h3>
  16. <form action="buscador.php" method="POST" name="frm" id="buscado">
  17.   <span class="style1"><strong>Nº Solicitud:</strong></span>
  18.   <input name="buscado" type="text" id="buscado" size="10" maxlength="10">
  19.   <br>
  20.   <br>
  21. <input name="buscar" type="submit" id="buscar" value="Buscar">
  22. </form>
  23. <?php PiePagina(); ?>
  24. </body>
  25. </html>
  26.  
  27.  

y este es el code donde hago la busqueda y posterio impresion por pantalla.

Código: Text
  1.  
  2. <html>
  3. <style type="text/css">
  4. <!--
  5. .style13 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
  6. -->
  7. </style>
  8. <body>
  9. <?php include("formato.php"); ?>
  10. <?php CabeceraPagina(); ?>
  11. <?php
  12. if (!isset($buscado)){
  13.   echo "<p>Debe ingresar un Nº de Solicitud.</p> \n";
  14.   echo "<p><a href=fbusqueda.php>Volver</p> \n";
  15.   echo "</html></body> \n";
  16.   exit;
  17. }
  18. $link = mysql_connect("localhost", "root", "");
  19. mysql_select_db("db_soporte", $link);
  20. $sql = "SELECT folio FROM tbl_maestra WHERE (folio = '$buscado')";
  21. $result = mysql_query($sql, $link);
  22. ?>
  23.     <TABLE height="5%" BORDER=1 CELLPADDING=0 CELLSPACING=0>
  24.       <TR>
  25.         <TD width="100"><span class="style13"> Nº Solicitud  </span></TD>
  26.         <TD width="100"><span class="style13"> Fecha  </span></TD>
  27.         <TD width="150"><span class="style13"> Solicitante </span></TD>
  28.         <TD width="100"><span class="style13"> Cargo </span></TD>
  29.         <TD width="150"><span class="style13"> Dir. / Depto. </span></TD>
  30.         <TD width="100"><span class="style13"> Sistema </span></TD>
  31.     <TD width="100"><span class="style13"> Solicitud </span></TD>
  32.     <td width="200"><span class="style13"> Estado </span></td>
  33.       </TR>
  34. <?php      
  35.    while($row = mysql_fetch_array($result)) {
  36.       printf("<tr>
  37.           <td><span class='style13'> %s</span></td>
  38.         <td><span class='style13'> %s</span></td>
  39.         <td><span class='style13'> %s</span></td>
  40.         <td><span class='style13'> %s</span></td>
  41.         <td><span class='style13'> %s</span></td>
  42.         <td><span class='style13'> %s</span></td>
  43.         <td><span class='style13'> %s</span></td>
  44.         <td><span class='style13'> %s</span></td>
  45.       </tr>",
  46.       $row["folio"],
  47.       $row["fecha_solicitud"],
  48.       $row["hora_solicitud"],
  49.       $row["nombre_usuario"],
  50.       $row["depto_usuario"],
  51.       $row["tipo_requerimiento"],
  52.       $row["tecnico_asignado"],
  53.       $row["estado_atencion"]);
  54. }
  55. echo "<p><a href=fbusqueda.php>Volver</p> \n";
  56. ?>
  57. </table>
  58. <?php PiePagina(); ?>
  59. </body>
  60. </html>
  61.  
  62.  
Un Tigre Nunka Kambia Sus Rayas

neorent

  • Miembro MUY activo
  • ***
  • Mensajes: 249
    • Ver Perfil
    • http://www.laestokada.cl
Re: No Funciona Buscador??????
« Respuesta #1 en: Lunes 11 de Septiembre de 2006, 22:34 »
0
Cita de: "neorent"
hola amigos del foro, bueno aqui con otro problema, estoy haciendo una buscador exacto y no me funciona segun yo el code esta ok pero no se que pasa, bueno les dejo el code para me digan si hay algo malo en el o definitivamente esta malo mi pc, gracias

bueno este es el formulario donde paso el valor al buscar
se llama fbusqueda.php

Código: Text
  1.  
  2. <html>
  3. <head>
  4. <title>Solicitudes de mantención</title>
  5. </head>
  6. <style type="text/css">
  7. <!--
  8. .style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
  9. .style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
  10. -->
  11. </style>
  12. <body>
  13. <?php include("formato.php"); ?>
  14. <?php CabeceraPagina(); ?>
  15. <h3>Buscar Solicitud </h3>
  16. <form action="buscador.php" method="POST" name="frm" id="buscado">
  17.   <span class="style1"><strong>Nº Solicitud:</strong></span>
  18.   <input name="buscado" type="text" id="buscado" size="10" maxlength="10">
  19.   <br>
  20.   <br>
  21. <input name="buscar" type="submit" id="buscar" value="Buscar">
  22. </form>
  23. <?php PiePagina(); ?>
  24. </body>
  25. </html>
  26.  
  27.  

y este es el code donde hago la busqueda y posterio impresion por pantalla.

Código: Text
  1.  
  2. <html>
  3. <style type="text/css">
  4. <!--
  5. .style13 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
  6. -->
  7. </style>
  8. <body>
  9. <?php include("formato.php"); ?>
  10. <?php CabeceraPagina(); ?>
  11. <?php
  12. if (!isset($buscado)){
  13.   echo "<p>Debe ingresar un Nº de Solicitud.</p> \n";
  14.   echo "<p><a href=fbusqueda.php>Volver</p> \n";
  15.   echo "</html></body> \n";
  16.   exit;
  17. }
  18. $link = mysql_connect("localhost", "root", "");
  19. mysql_select_db("db_soporte", $link);
  20. $sql = "SELECT folio FROM tbl_maestra WHERE (folio = '$buscado')";
  21. $result = mysql_query($sql, $link);
  22. ?>
  23.     <TABLE height="5%" BORDER=1 CELLPADDING=0 CELLSPACING=0>
  24.       <TR>
  25.         <TD width="100"><span class="style13"> Nº Solicitud  </span></TD>
  26.         <TD width="100"><span class="style13"> Fecha  </span></TD>
  27.         <TD width="150"><span class="style13"> Solicitante </span></TD>
  28.         <TD width="100"><span class="style13"> Cargo </span></TD>
  29.         <TD width="150"><span class="style13"> Dir. / Depto. </span></TD>
  30.         <TD width="100"><span class="style13"> Sistema </span></TD>
  31.     <TD width="100"><span class="style13"> Solicitud </span></TD>
  32.     <td width="200"><span class="style13"> Estado </span></td>
  33.       </TR>
  34. <?php      
  35.    while($row = mysql_fetch_array($result)) {
  36.       printf("<tr>
  37.           <td><span class='style13'> %s</span></td>
  38.         <td><span class='style13'> %s</span></td>
  39.         <td><span class='style13'> %s</span></td>
  40.         <td><span class='style13'> %s</span></td>
  41.         <td><span class='style13'> %s</span></td>
  42.         <td><span class='style13'> %s</span></td>
  43.         <td><span class='style13'> %s</span></td>
  44.         <td><span class='style13'> %s</span></td>
  45.       </tr>",
  46.       $row["folio"],
  47.       $row["fecha_solicitud"],
  48.       $row["hora_solicitud"],
  49.       $row["nombre_usuario"],
  50.       $row["depto_usuario"],
  51.       $row["tipo_requerimiento"],
  52.       $row["tecnico_asignado"],
  53.       $row["estado_atencion"]);
  54. }
  55. echo "<p><a href=fbusqueda.php>Volver</p> \n";
  56. ?>
  57. </table>
  58. <?php PiePagina(); ?>
  59. </body>
  60. </html>
  61.  
  62.  
BUENO YA RESOLVI EL PROBLEMA NO SE PASABA LA VARIABLE CON LOS DATOS ASI QUE PUSE ESTO U FUNCIONO.

$i_buscado=$_REQUEST['buscado'];

GRACIAS POR LA AYUDA A TODOS ADIOS
Un Tigre Nunka Kambia Sus Rayas