Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/04/2012, 01:41
Avatar de YYs86
YYs86
 
Fecha de Ingreso: abril-2012
Ubicación: Salamanca
Mensajes: 136
Antigüedad: 12 años
Puntos: 14
Respuesta: Problemas mostrar tabla dinamica

No a ver el if tienes que ir por encima del do_while(), para que lo ejecute sólo si se ha mandado por $_POST el submit indicado.

Quedaría una cosa así:

Código PHP:
Ver original
  1. <form id="BUSCAR" name="BUSCAR" method="post" action="">
  2. * <label><span class="Estilo1">Buscar publicacion articulo</span>:
  3. * <input name="TITULO" type="text" id="TITULO" />
  4. * <input type="submit" name="Submit" value="BUSCAR" />
  5. * </label>
  6. * <p>&nbsp;</p>
  7. *
  8. *
  9. *
  10. *
  11. * <table border="2" cellpadding="3" cellspacing="2" width="845" bordercolor="transparent">
  12. * * <tr>
  13. * * * <td bgcolor="#b8cce4" bordercolor="transparent"><strong>EDITAR</strong></td>
  14. * * * <td bgcolor="#b8cce4" bordercolor="transparent"><strong>ELIMINAR</strong></td>
  15. * * * <td bgcolor="#b8cce4" bordercolor="transparent"><strong>TITULO</strong></td>
  16. * * * <td bgcolor="#b8cce4" bordercolor="transparent"><strong>SECCION</strong></td>
  17. * * * <td bgcolor="#b8cce4" bordercolor="transparent"><strong>FECHA</strong></td>
  18. * * * <td bgcolor="#b8cce4" bordercolor="transparent"><strong>NOMBRE</strong></td>
  19. * * </tr>
  20.     <?php if(isset($_POST['BUSCAR']){ ?>
  21. * * <?php do { ?>
  22. * * * <tr>
  23. * * * <td bordercolor="transparent"><div align="center"><img src="css/images/edit.png"></div></td>
  24. * * * <td bordercolor="transparent"><div align="center"><img src="css/images/delete.png"></div></td>
  25. * * * * <td bordercolor="transparent"><?php echo $row_BUSCAR_ARTICULO['TITULO']; ?></td>
  26. * * * * <td bordercolor="transparent"><?php echo $row_BUSCAR_ARTICULO['SECCION']; ?></td>
  27. * * * * <td bordercolor="transparent"><?php echo $row_BUSCAR_ARTICULO['FECHA']; ?></td>
  28. * * * * <td bordercolor="transparent"><?php echo $row_BUSCAR_ARTICULO['NOMBRE']; ?></td>
  29. * * * </tr>
  30. * * * <?php } while ($row_BUSCAR_ARTICULO = mysql_fetch_assoc($BUSCAR_ARTICULO)); ?>
  31.       <? }else{ ?>
  32.       <tr><td colspan="6">Introduce algo en la búsqueda</td></tr>
  33.       <? } ?
  34. * </table>
  35. </form>