Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/10/2010, 11:26
ditin
 
Fecha de Ingreso: octubre-2010
Mensajes: 29
Antigüedad: 13 años, 7 meses
Puntos: 0
Respuesta: Problema anidacion consulta

Código MySQL:
Ver original
  1. $query = "SELECT * FROM bookings WHERE (
  2.                                        (the_date='" . $_POST['the_date'] . "' and id_item='". $_POST['id_item'] . "')
  3.                                         AND ((horario='". $_POST['horario'] . "' or horario='Completo')
  4.                                        )
  5.                                  OR (
  6.                                        ( the_date='" . $_POST['the_date'] . "' and id_item='". $_POST['id_item'] . "' and horario='Manana')
  7.                                         AND (the_date='" . $_POST['the_date'] . "' and id_item='". $_POST['id_item'] . "' and horario='Tarde')
  8.                                      )
  9. )";

Creo que con esa "identacion" .. se ve .. algo mejor la logica ... y claro como dijeron arriba solo te falto un ")"... que cerrara el WHERE .. :)
saludos