Ver Mensaje Individual
  #12 (permalink)  
Antiguo 25/09/2008, 08:50
Avatar de mgusdl
mgusdl
 
Fecha de Ingreso: abril-2007
Ubicación: Malaga, España
Mensajes: 190
Antigüedad: 18 años
Puntos: 5
Respuesta: Select SQL con 3 campos, no se como

Cita:
Iniciado por sjam7 Ver Mensaje
pues seria algo asi:

Selecciona TODO detabla ANUNCIOS donde IMAGEN<>"" y CREDITO=FALSE o (CREDITO=True y CREDITOS>0)
Por ahi van los tiros, usa parentesis para agrupar las condiciones, por ejemplo

SELECT * FROM anuncios WHERE (imagen IS NOT NULL AND credito=0) OR (saldo>0 AND credito=1) ORDER BY credito DESC

Yo incluso almacenaria a los anunciantes por un lado y las imagenes por otro