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 isCancelled = 0' at line 6
CHECK THE URL =>
SELECT COUNT(*) AS nb FROM t_reservations WHERE date = {d '2014-10-31'} AND periode = '0' AND studios_fk = AND isCancelled = 0