Ver Mensaje Individual
  #17 (permalink)  
Antiguo 03/09/2008, 08:20
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 8 meses
Puntos: 2135
Respuesta: Necesito vuestros sabios consejos....a modo de reto!

El código de Jerkan te debería de funcionar, pero prueba esto para ver como se esta construyendo el SQL:
Código PHP:
$where = array();

if( 
$provincia != )
{
    
$where[] = "provincia='$provincia'";
}


if( 
$categoria != )
{
    
$where[] = "categoria ='$categoria '";
}

$where_sql '';
if( 
count($where) > )
{
    
$where_sql ' WHERE ' implode(' AND '$where);
}

var_dump($where);

$sql1 "SELECT * FROM datos_ofertas $where_sql"
echo 
$sql1
Saludos.