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 DATE(sp_dob) IS NOT NULL and sp_dob!='1900-01-01' and DATE_FORMAT(CONVER...' at line 1
select sp_id, sp_name, sp_father_name, sp_dob, sp_photo, class_name, section_name from tbl_student_profile, tbl_class, tbl_section where tbl_student_profile.status!=0 and class_id=sp_current_class_id and section_id=sp_current_section_id and sp_current_session_id= and DATE(sp_dob) IS NOT NULL and sp_dob!='1900-01-01' and DATE_FORMAT(CONVERT_TZ( NOW(), 'SYSTEM', '+05:30' ), '%m-%d')=DATE_FORMAT(CONVERT_TZ( sp_dob, 'SYSTEM', '+05:30' ), '%m-%d')