use different query

This commit is contained in:
Nathan Coad
2018-05-04 22:49:49 +10:00
parent b283cadcf9
commit 04bfd9d876

View File

@@ -387,10 +387,14 @@ function booking_varietysessions_csv_report($timeslot_id) {
} }
//retrieve the sessions for the specified timeslot //retrieve the sessions for the specified timeslot
$variety_sessions = db_query("SELECT * FROM {booking_variety_sessions} WHERE booking_eventid = :eid and booking_variety_timeslot_id = :tid", $variety_sessions = db_select('booking_variety_sessions', 'v');
array(':eid' => $event->eid, ':tid' => $timeslot_id)); $db_and = db_and();
$db_and->condition('v.booking_eventid', $event->eid, '=');
if (! $variety_sessions) { $db_and->condition('v.booking_variety_timeslot_id', $timeslot_id, '=');
$variety_sessions->fields('v')
->execute();
if ($variety_sessions->rowCount() == 0) {
drupal_set_message("Error: Could not find matching variety session timeslot. Unable to view session membership.", 'error', FALSE); drupal_set_message("Error: Could not find matching variety session timeslot. Unable to view session membership.", 'error', FALSE);
drupal_goto('admin/config/booking/variety'); drupal_goto('admin/config/booking/variety');
return ""; return "";