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 'AND `month` = AND `day` = ORDER BY `day` ASC' at line 1 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 'AND `month` = AND `day` = AND cancel = 0 ORDER BY `day` ASC' at line 1