Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' 0)) AS total_remaining FROM events e JOIN ticket_types t ON t.event_id =...' at line 1 in /home/studiop/public_html/tickets.php:6 Stack trace: #0 /home/studiop/public_html/tickets.php(6): PDO->query('\n SELECT e.*...') #1 {main} thrown in /home/studiop/public_html/tickets.php on line 6