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.category_name, count(b.project_id) proj_cnt,image_link,sum(b.project_target_budget) project_value,c.dept_name FROM `dotp_project_category` a LEFT JOIN dotp_projects b ON b.project_type = 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: 219