Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ), # AND webinars.posted = 1, ' at line 77
Query: SELECT webinars.id, webinars.parent_id, webinar_topics.id AS topic_id, webinar_topics.name AS topic_name, webinar_topics.name_short AS topic_name_short, webinars.code, webinars.sort, webinars.title, webinars.format, webinars.posted, webinars.status, webinars.num_sessions, webinars.date_live, webinars.date_ondemand, webinars.timezone, webinars.is_live, webinars.is_ondemand, webinars.ondemand_ready, webinar_instructors.id AS instructor_id, webinar_instructors.name AS instructor_name, webinar_instructors.title AS instructor_title, webinar_instructors.description AS instructor_description, # IF( # webinars.format = 'live', # FLOOR(TIME_TO_SEC(TIMEDIFF(time_end, webinars.time_start))/60), # NULL # ) AS duration_live, # webinars.ondemand_media_id, # webinars.ondemand_duration, webinars.price_first, webinars.price_second, webinars.price_addtl, DATE_FORMAT(MIN(webinars.date_live), '%M %D') AS date_live_friendly, DATE_FORMAT(MIN(webinars.date_live), '%b %e') AS date_live_friendly_short, DATE_FORMAT(MIN(webinars.date_live), '%W, %M %D') AS date_live_friendly_full, DATE_FORMAT(MIN(webinars.date_ondemand), '%M %D') AS date_ondemand_friendly, DATE_FORMAT(MIN(webinars.date_ondemand), '%b %e') AS date_ondemand_friendly_short, TIME_FORMAT(MIN(webinar_sessions.time_start), '%l:%i %p') AS time_start_friendly, TIME_FORMAT(MAX(webinar_sessions.time_end), '%l:%i %p') AS time_end_friendly, webinars.timezone, # 'Half Day' AS duration_friendly, CASE WHEN COUNT(webinar_sessions.id) > 2 THEN 'Half Day' WHEN webinars.format = 'live' AND COUNT(webinar_sessions.id) = 1 THEN CONCAT(SUM(FLOOR(TIME_TO_SEC(TIMEDIFF(webinar_sessions.time_end, webinar_sessions.time_start))/60)),' ','Minute') WHEN webinars.format = 'ondemand' AND COUNT(webinar_sessions.id) > 1 THEN CASE WHEN MOD(SUM(webinar_sessions.ondemand_duration),60) > 45 THEN CONCAT(CEIL(SUM(webinar_sessions.ondemand_duration)/60), ' Hour') WHEN MOD(SUM(webinar_sessions.ondemand_duration),60) > 15 THEN CONCAT(FLOOR(SUM(webinar_sessions.ondemand_duration)/60), '.5 Hour') ELSE CONCAT(FLOOR(SUM(webinar_sessions.ondemand_duration)/60), ' Hour') END END AS duration_friendly, MOD(SUM(webinar_sessions.ondemand_duration),60), SUM(webinar_sessions.ondemand_duration)/60, SUM(FLOOR(TIME_TO_SEC(TIMEDIFF(webinar_sessions.time_end, webinar_sessions.time_start))/60)) AS duration_live, webinars.intro, webinars.learn, webinars.also_learn, webinars.agenda, webinars.attend, webinars.prereq, webinars.prereq, webinars.choose, webinars.datetime_created, webinars.datetime_updated, webinars.datetime_deleted, IF( webinars.is_live = 1 AND ( webinars.date_live > DATE(NOW()) OR (webinars.date_live = DATE(NOW()) AND MIN(webinar_sessions.time_start) < ) ), # AND webinars.posted = 1, 1,0 ) AS live_available, IF( (webinars.format = 'live' AND (webinars.date_live < DATE(NOW()) OR ISNULL(webinars.date_live))) OR webinars.posted = 0, 0, 1 ) AS available, DATE(NOW()) AS date_now, TIME(NOW()) AS time_now, TIME(DATE_ADD(NOW(), INTERVAL 1 HOUR)) AS time_now_plus_hour, NOW() AS datetime_now # IF( # ( # webinars.format = 'live' AND # ( # (COUNT(webinar_sessions.id) > 0 AND MIN(webinar_sessions.date_live) < DATE(NOW())) # OR COUNT(webinar_sessions.id) = 0 # ) # ) OR # webinars.posted = 0, # 0, # 1 # ) # AS available FROM webinars JOIN webinar_topics ON (webinars.topic_id = webinar_topics.id) LEFT JOIN webinar_sessions ON (webinar_sessions.webinar_id = webinars.id) LEFT JOIN webinar_instructors ON (webinar_instructors.id = webinars.instructor_id) # LEFT JOIN ( # # ) WHERE webinars.datetime_deleted IS NULL AND webinars.id = '39' AND webinars.status = 'active' GROUP BY webinars.id ORDER BY webinar_topics.sort, webinars.sort
File: /home/pgsenerg/public_html/include/function.webinar.php
Line: 1339