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 '*, offices.NAME As officeName, agents.NAME As agentName, common.OFFICE1ID FROM o' at line 1