Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/09/2008, 04:47
Avatar de jerkan
jerkan
 
Fecha de Ingreso: septiembre-2005
Mensajes: 1.607
Antigüedad: 19 años, 4 meses
Puntos: 19
Respuesta: Necesito vuestros sabios consejos....a modo de reto!

Yo lo haría así:
Código PHP:
$where = array();

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


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

if( !empty(
$where) )
{
    
$where_sql implode(' AND '$where);
}

$sql1 "SELECT * FROM datos_ofertas $where_sql"
Un saludo