Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/08/2009, 19:10
Avatar de urgido
urgido
 
Fecha de Ingreso: febrero-2005
Mensajes: 2.351
Antigüedad: 19 años, 2 meses
Puntos: 25
Respuesta: Mostrar resultados

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