DBX ERROR: Database error: 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 'and MS.stalltype_id IN (1,3,5)
            and stalls.`status`="Active" and MS.' at line 6Last Query:    SELECT DISTINCT stalls.stall_id,stalls.name,stalls.description,sites.site_reference from market_sites MS
            join stalls on MS.stall_id = stalls.stall_id
            join stall_sites on stalls.stall_id=stall_sites.stall_id
            join sites on sites.site_id=stall_sites.site_id
            where MS.market_id=
            and MS.stalltype_id IN (1,3,5)
            and stalls.`status`="Active" and MS.`status`="Active"   order by stalls.name asc