Ver Mensaje Individual
  #6 (permalink)  
Antiguo 31/07/2008, 08:04
Avatar de JuanRAPerez
JuanRAPerez
Colaborador
 
Fecha de Ingreso: octubre-2003
Mensajes: 2.393
Antigüedad: 23 años
Puntos: 27
Respuesta: Busqueda con diferentes variables

Estos tus valores enviados

edad
categoria1
sexo
poblacion
provincia
pretencion_economica
tipo_jornada


si viene con valor es que hay que meterlos en la cadena


Código PHP:
sql = "select * from curriculums where "
SLQAnexo = ""


if edad <> "" then
     SLQAnexo 
= SLQAnexo & "edad = " & edad & " and "
end if

if 
categoria1 <> "" then
     SLQAnexo 
= SLQAnexo l & "categoria1 = " & categoria1  & " and "
end if


if 
sexo <> "" then
     SLQAnexo 
= SLQAnexo  & "sexo = " & sexo  & " and "
end if
...

luego cortas el ultimo and 
SLQAnexo = mid(SLQAnexo,1,len(SLQAnexo) - 4)

SQL = SQL & SLQAnexo 

digo no se si así te jale mejor
[ando desvariando[

suerte
__________________
JuanRa Pérez
San Salvador, El Salvador