Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/03/2013, 11:05
alex1084
 
Fecha de Ingreso: abril-2008
Ubicación: El Salvador
Mensajes: 736
Antigüedad: 16 años
Puntos: 47
Respuesta: problema con busqueda while en MySql y PHP

Prueba esto


Código PHP:
Ver original
  1. <?php
  2. $busca = "";
  3. $busca=$_POST['busca'];
  4. $con = mysql_connect("localhost","*****","******");
  5. mysql_select_db("sitio",$con);
  6. if ($busca != ""){
  7. $busqueda = mysql_query("SELECT NOMBRE FROM archivos WHERE NOMBRE LIKE '%".$busca."%'");
  8.  
  9. while($f = mysql_fetch_array($busqueda)){
  10.     $lista.='<tr><td><a href="uploads/'.$f["NOMBRE"].'">'.$f["NOMBRE"].'</a></td><td></td></tr>';
  11. }
  12.  
  13. ?>
  14. <table border=1>
  15.  
  16. <tr>
  17. <td><strong>Nombre del archivo</strong></td>
  18. <td><strong>Peso del archivo</strong></td>
  19. </tr><?php echo $lista; ?>    
  20. </table>