Ver Mensaje Individual
  #3 (permalink)  
Antiguo 22/08/2009, 18:10
Avatar de tampon
tampon
 
Fecha de Ingreso: julio-2009
Mensajes: 420
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: Mostrar resultados

Pffff.... tienes razon jajaja una disculpa, bueno cheque el codigo y me quedo asi:

Código php:
Ver original
  1. <?php
  2.  
  3. include('config.php');
  4.  
  5. if(isset($_GET['search_word']))
  6. {
  7. $search_word=$_GET['search_word'];
  8.  
  9. $sql=mysql_query("SELECT * FROM tabla_registros WHERE matricula LIKE '%$search_word%' ORDER BY registrado");
  10. $con = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
  11. mysql_select_db($mysql_database, $con);
  12. mysql_query("SET NAMES 'utf8'");
  13.  
  14. $count=mysql_num_rows($sql);
  15.  
  16. if($count > 0)
  17. {
  18.  
  19. while($row=mysql_fetch_array($sql))
  20. {
  21. $matricula=$row['matricula'];
  22. $bold_word='<b>'.$search_word.'</b>';
  23. $final_msg = str_ireplace($search_word, $bold_word, $matricula);
  24.  
  25.  
  26. echo "<table cellspacing='1' class='tablesorter'>
  27. <thead>
  28. <tr>
  29. <th>Nombre</th>
  30. <th>Matricula</th>
  31. <th>Concepto pagado</th>
  32. <th>Cantidad pagada</th>
  33. <th>Folio de pago</th>
  34. </tr>
  35. </thead>";
  36.  
  37. while($row = mysql_fetch_array($sql))
  38.   {
  39.   echo "<tbody> <tr>";
  40.   echo "<td class='name'>" . $row['nombre'] . "</td>";
  41.   echo "<td class='id'>" . $row['matricula'] . "</td>";
  42.   echo "<td>" . $row['concepto'] . "</td>";
  43.   echo "<td> $ " . $row['valor'] . " pesos</td>";
  44.   echo "<td>" . $row['folio'] . "</td>";
  45.   echo "</tr>";
  46.   }
  47. echo "</tbody> </table>";
  48.  
  49. }
  50. }
  51. else
  52. {
  53.  
  54. echo "Verifica la matricula, no se encontraron registros.";
  55.  
  56. }
  57.  
  58. }
  59. ?>

pero ahora solo me apatece la primera sila de la tabla pero nada de informacion.

Última edición por tampon; 22/08/2009 a las 18:31