I am converting a Drupal 6 module to a Drupal 7 module. I have come across the following database query that I don't know how to convert to the new Drupal 7 format.
$sql = "
SELECT id
FROM {room_reservations}
WHERE (
(deleted = '%s' AND room = '%s' AND date = '%s' AND time = '%s' AND length > %d)
OR
(deleted = '%s' AND room = '%s' AND date = '%s' AND time = '%s' AND length > %d)
OR
(deleted = '%s' AND room = '%s' AND date = '%s' AND time = '%s' AND length > %d)
)
";
Although the where clauses do repeat itself, each substituted value in there is different. My question is how does one construct such a statement in Drupal 7 using the new database API? Can you mix and and or statements?
Thanks.