Ver Mensaje Individual
  #13 (permalink)  
Antiguo 22/08/2009, 20:52
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'])){ //isset
  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){ // count
  16.  
  17. echo "<table cellspacing='1' class='tablesorter'>";
  18.  echo "
  19. <thead>
  20. <tr>
  21. <th>Nombre</th>
  22. <th>Matricula</th>
  23. <th>Concepto pagado</th>
  24. <th>Cantidad pagada</th>
  25. <th>Folio de pago</th>
  26. </tr>
  27. </thead>";
  28. while($row=mysql_fetch_array($sql)){ // while
  29. $matricula=$row['matricula'];
  30. $bold_word='<b>'.$search_word.'</b>';
  31. $final_msg = str_ireplace($search_word, $bold_word, $matricula);
  32.  
  33.  
  34.  
  35.  
  36.   echo "<tbody> <tr>";
  37.   echo "<td class='name'>" . $row['nombre'] . "</td>";
  38.   echo "<td class='id'>" . $row['matricula'] . "</td>";
  39.   echo "<td>" . $row['concepto'] . "</td>";
  40.   echo "<td> $ " . $row['valor'] . " pesos</td>";
  41.   echo "<td>" . $row['folio'] . "</td>";
  42.   echo "</tr>";
  43. } // while
  44. echo "</tbody> </table>";
  45. }else{ // count
  46.  echo "Verifica la matricula, no se encontraron registros.";
  47. }
  48. } // isset
  49. ?>

no sé, si asi sirva la verdad pero checalo y dime que paso. Saludos
__________________
Hospedaje Web al mejor costo!