A Database Error Occurred

Error Number: 1064

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 'JOIN dotp_departments c ON c.dept_id = b.project_department where a.status=1 gr' at line 1

SELECT a.id,a.theme_name, count(b.project_id) proj_cnt,a.image,sum(b.project_target_budget) project_value,c.dept_name FROM `dotp_ayodhya_themes` a LEFT JOIN dotp_projects b ON b.ayodhya_theme = a.id and b.project_department= LEFT JOIN dotp_departments c ON c.dept_id = b.project_department where a.status=1 group by a.id

Filename: models/Home_model.php

Line Number: 232