Ver Mensaje Individual
  #6 (permalink)  
Antiguo 30/10/2011, 10:16
Avatar de Ronruby
Ronruby
 
Fecha de Ingreso: julio-2008
Ubicación: 18°30'N, 69°59'W
Mensajes: 4.879
Antigüedad: 15 años, 9 meses
Puntos: 416
Respuesta: problema al hacer un filtrado

Código PHP:
Ver original
  1. <?php
  2.  
  3. $sql = "SELECT * FROM Peliculas WHERE 1=1";
  4.  
  5. if(!empty($_POST['pelicula'])){
  6.     $sql .= " AND Nombre = '{$_POST['pelicula']}'";
  7. }
  8. if(!empty($_POST['genero'])){
  9.     $sql .= " AND Genero = '{$_POST['genero']}'";
  10. }