{"_explicitType":"flex.messaging.messages.ErrorMessage","faultCode":"AMFPHP_RUNTIME_ERROR","faultDetail":"\/var\/www\/html\/clubsg\/includes\/classes\/Database.php on line 201","faultString":"SQLSTATE[HY000]: General error: 20018 Invalid column name 'undefined'. [20018] (severity 16) [SELECT SUM(CASE WHEN f.h1=3 THEN 1 ELSE 0 END+CASE WHEN f.h2=3 THEN 1 ELSE 0 END+CASE WHEN f.h3=3 THEN 1 ELSE 0 END+CASE WHEN f.h4=3 THEN 1 ELSE 0 END+CASE WHEN f.h5=3 THEN 1 ELSE 0 END+CASE WHEN f.h6=3 THEN 1 ELSE 0 END+CASE WHEN f.h7=3 THEN 1 ELSE 0 END+CASE WHEN f.h8=3 THEN 1 ELSE 0 END+CASE WHEN f.h9=3 THEN 1 ELSE 0 END+CASE WHEN f.h10=3 THEN 1 ELSE 0 END+CASE WHEN f.h11=3 THEN 1 ELSE 0 END+CASE WHEN f.h12=3 THEN 1 ELSE 0 END+CASE WHEN f.h13=3 THEN 1 ELSE 0 END+CASE WHEN f.h14=3 THEN 1 ELSE 0 END+CASE WHEN f.h15=3 THEN 1 ELSE 0 END+CASE WHEN f.h16=3 THEN 1 ELSE 0 END+CASE WHEN f.h17=3 THEN 1 ELSE 0 END+CASE WHEN f.h18=3 THEN 1 ELSE 0 END) as fairway_left,\r\n\t\t\t\t\t\tSUM(CASE WHEN f.h1=2 THEN 1 ELSE 0 END+CASE WHEN f.h2=2 THEN 1 ELSE 0 END+CASE WHEN f.h3=2 THEN 1 ELSE 0 END+CASE WHEN f.h4=2 THEN 1 ELSE 0 END+CASE WHEN f.h5=2 THEN 1 ELSE 0 END+CASE WHEN f.h6=2 THEN 1 ELSE 0 END+CASE WHEN f.h7=2 THEN 1 ELSE 0 END+CASE WHEN f.h8=2 THEN 1 ELSE 0 END+CASE WHEN f.h9=2 THEN 1 ELSE 0 END+CASE WHEN f.h10=2 THEN 1 ELSE 0 END+CASE WHEN f.h11=2 THEN 1 ELSE 0 END+CASE WHEN f.h12=2 THEN 1 ELSE 0 END+CASE WHEN f.h13=2 THEN 1 ELSE 0 END+CASE WHEN f.h14=2 THEN 1 ELSE 0 END+CASE WHEN f.h15=2 THEN 1 ELSE 0 END+CASE WHEN f.h16=2 THEN 1 ELSE 0 END+CASE WHEN f.h17=2 THEN 1 ELSE 0 END+CASE WHEN f.h18=2 THEN 1 ELSE 0 END) as fairway_right,\r\n\t\t\t\t\t\tSUM(CASE WHEN f.h1=0 THEN 1 ELSE 0 END+CASE WHEN f.h2=0 THEN 1 ELSE 0 END+CASE WHEN f.h3=0 THEN 1 ELSE 0 END+CASE WHEN f.h4=0 THEN 1 ELSE 0 END+CASE WHEN f.h5=0 THEN 1 ELSE 0 END+CASE WHEN f.h6=0 THEN 1 ELSE 0 END+CASE WHEN f.h7=0 THEN 1 ELSE 0 END+CASE WHEN f.h8=0 THEN 1 ELSE 0 END+CASE WHEN f.h9=0 THEN 1 ELSE 0 END+CASE WHEN f.h10=0 THEN 1 ELSE 0 END+CASE WHEN f.h11=0 THEN 1 ELSE 0 END+CASE WHEN f.h12=0 THEN 1 ELSE 0 END+CASE WHEN f.h13=0 THEN 1 ELSE 0 END+CASE WHEN f.h14=0 THEN 1 ELSE 0 END+CASE WHEN f.h15=0 THEN 1 ELSE 0 END+CASE WHEN f.h16=0 THEN 1 ELSE 0 END+CASE WHEN f.h17=0 THEN 1 ELSE 0 END+CASE WHEN f.h18=0 THEN 1 ELSE 0 END) as fairway_miss,\r\n\t\t\t\t\t\tSUM(CASE WHEN f.h1=1 THEN 1 ELSE 0 END+CASE WHEN f.h2=1 THEN 1 ELSE 0 END+CASE WHEN f.h3=1 THEN 1 ELSE 0 END+CASE WHEN f.h4=1 THEN 1 ELSE 0 END+CASE WHEN f.h5=1 THEN 1 ELSE 0 END+CASE WHEN f.h6=1 THEN 1 ELSE 0 END+CASE WHEN f.h7=1 THEN 1 ELSE 0 END+CASE WHEN f.h8=1 THEN 1 ELSE 0 END+CASE WHEN f.h9=1 THEN 1 ELSE 0 END+CASE WHEN f.h10=1 THEN 1 ELSE 0 END+CASE WHEN f.h11=1 THEN 1 ELSE 0 END+CASE WHEN f.h12=1 THEN 1 ELSE 0 END+CASE WHEN f.h13=1 THEN 1 ELSE 0 END+CASE WHEN f.h14=1 THEN 1 ELSE 0 END+CASE WHEN f.h15=1 THEN 1 ELSE 0 END+CASE WHEN f.h16=1 THEN 1 ELSE 0 END+CASE WHEN f.h17=1 THEN 1 ELSE 0 END+CASE WHEN f.h18=1 THEN 1 ELSE 0 END) as fairway_hit,\r\n\t\t\t\t\t\t(SUM(CASE WHEN f.h1=3 THEN 1 ELSE 0 END+CASE WHEN f.h2=3 THEN 1 ELSE 0 END+CASE WHEN f.h3=3 THEN 1 ELSE 0 END+CASE WHEN f.h4=3 THEN 1 ELSE 0 END+CASE WHEN f.h5=3 THEN 1 ELSE 0 END+CASE WHEN f.h6=3 THEN 1 ELSE 0 END+CASE WHEN f.h7=3 THEN 1 ELSE 0 END+CASE WHEN f.h8=3 THEN 1 ELSE 0 END+CASE WHEN f.h9=3 THEN 1 ELSE 0 END+CASE WHEN f.h10=3 THEN 1 ELSE 0 END+CASE WHEN f.h11=3 THEN 1 ELSE 0 END+CASE WHEN f.h12=3 THEN 1 ELSE 0 END+CASE WHEN f.h13=3 THEN 1 ELSE 0 END+CASE WHEN f.h14=3 THEN 1 ELSE 0 END+CASE WHEN f.h15=3 THEN 1 ELSE 0 END+CASE WHEN f.h16=3 THEN 1 ELSE 0 END+CASE WHEN f.h17=3 THEN 1 ELSE 0 END+CASE WHEN f.h18=3 THEN 1 ELSE 0 END)+SUM(CASE WHEN f.h1=2 THEN 1 ELSE 0 END+CASE WHEN f.h2=2 THEN 1 ELSE 0 END+CASE WHEN f.h3=2 THEN 1 ELSE 0 END+CASE WHEN f.h4=2 THEN 1 ELSE 0 END+CASE WHEN f.h5=2 THEN 1 ELSE 0 END+CASE WHEN f.h6=2 THEN 1 ELSE 0 END+CASE WHEN f.h7=2 THEN 1 ELSE 0 END+CASE WHEN f.h8=2 THEN 1 ELSE 0 END+CASE WHEN f.h9=2 THEN 1 ELSE 0 END+CASE WHEN f.h10=2 THEN 1 ELSE 0 END+CASE WHEN f.h11=2 THEN 1 ELSE 0 END+CASE WHEN f.h12=2 THEN 1 ELSE 0 END+CASE WHEN f.h13=2 THEN 1 ELSE 0 END+CASE WHEN f.h14=2 THEN 1 ELSE 0 END+CASE WHEN f.h15=2 THEN 1 ELSE 0 END+CASE WHEN f.h16=2 THEN 1 ELSE 0 END+CASE WHEN f.h17=2 THEN 1 ELSE 0 END+CASE WHEN f.h18=2 THEN 1 ELSE 0 END)+SUM(CASE WHEN f.h1=0 THEN 1 ELSE 0 END+CASE WHEN f.h2=0 THEN 1 ELSE 0 END+CASE WHEN f.h3=0 THEN 1 ELSE 0 END+CASE WHEN f.h4=0 THEN 1 ELSE 0 END+CASE WHEN f.h5=0 THEN 1 ELSE 0 END+CASE WHEN f.h6=0 THEN 1 ELSE 0 END+CASE WHEN f.h7=0 THEN 1 ELSE 0 END+CASE WHEN f.h8=0 THEN 1 ELSE 0 END+CASE WHEN f.h9=0 THEN 1 ELSE 0 END+CASE WHEN f.h10=0 THEN 1 ELSE 0 END+CASE WHEN f.h11=0 THEN 1 ELSE 0 END+CASE WHEN f.h12=0 THEN 1 ELSE 0 END+CASE WHEN f.h13=0 THEN 1 ELSE 0 END+CASE WHEN f.h14=0 THEN 1 ELSE 0 END+CASE WHEN f.h15=0 THEN 1 ELSE 0 END+CASE WHEN f.h16=0 THEN 1 ELSE 0 END+CASE WHEN f.h17=0 THEN 1 ELSE 0 END+CASE WHEN f.h18=0 THEN 1 ELSE 0 END)+SUM(CASE WHEN f.h1=1 THEN 1 ELSE 0 END+CASE WHEN f.h2=1 THEN 1 ELSE 0 END+CASE WHEN f.h3=1 THEN 1 ELSE 0 END+CASE WHEN f.h4=1 THEN 1 ELSE 0 END+CASE WHEN f.h5=1 THEN 1 ELSE 0 END+CASE WHEN f.h6=1 THEN 1 ELSE 0 END+CASE WHEN f.h7=1 THEN 1 ELSE 0 END+CASE WHEN f.h8=1 THEN 1 ELSE 0 END+CASE WHEN f.h9=1 THEN 1 ELSE 0 END+CASE WHEN f.h10=1 THEN 1 ELSE 0 END+CASE WHEN f.h11=1 THEN 1 ELSE 0 END+CASE WHEN f.h12=1 THEN 1 ELSE 0 END+CASE WHEN f.h13=1 THEN 1 ELSE 0 END+CASE WHEN f.h14=1 THEN 1 ELSE 0 END+CASE WHEN f.h15=1 THEN 1 ELSE 0 END+CASE WHEN f.h16=1 THEN 1 ELSE 0 END+CASE WHEN f.h17=1 THEN 1 ELSE 0 END+CASE WHEN f.h18=1 THEN 1 ELSE 0 END)) as fairway_total\r\n\t\t\t\tFROM score s WITH(NOLOCK)\r\n\t\t\t\tLEFT OUTER JOIN stat_hbh f WITH(NOLOCK) ON s.id = f.score_id AND f.stat_type_id = 2 LEFT OUTER JOIN stat_total ft WITH(NOLOCK) ON s.id = ft.score_id AND ft.stat_type_id = 2 WHERE s.is_complete=1 AND s.total_score IS NOT NULL AND s.total_par IS NOT NULL AND s.score_type IN (1,3,5) AND s.user_id = 0 AND s.play_date >= undefined AND s.play_date <= 1559314870 GROUP BY s.user_id]"}