MySQL Error!
------------------------

The Error returned was:
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 objects.arch=0 ORDER BY `objects`.`name` ASC' at line 39

Error Number:
1064
SELECT 
                        objects_ny.*, 
                        objects.alt_name_objects,
                        objects.id_tour,
                        objects.name,
                        objects.city,
                        objects.type,
                        objects.country,
                        objects.qvotas,
                        objects.period,
                        country.name_country,
                        country.id_country,
                        country.id_master,
                        komision.*,
                        city.namecity,
                        city.id_city,
                        city.designation,
                        objects_type.*,
                        objects.id_tour,
                        DATE_FORMAT(objects_ny.datestart, '%d.%m.%y') AS datestart,
                        DATE_FORMAT(objects_ny.datefinish, '%d.%m.%y') AS datefinish
                     FROM
                       objects
join geo_reference AS gr ON gr.id = objects.id_objects AND gr.type='object'
join geo ON geo.id = gr.geo_id
join region on region.geo_id = geo.id
join objects_ny ON objects_ny.id_obj = objects.id_objects
join komision ON komision.id_komis = objects_ny.komision 
join objects_type ON objects.type = objects_type.id_typeobject 

join geo_reference AS gr2 ON gr2.id = objects.id_objects AND gr2.type='object'
join country ON country.geo_id = gr2.geo_id

join geo_reference AS gr3 ON gr3.id = objects.id_objects AND gr3.type='object'
join city ON city.geo_id = gr3.geo_id

                     WHERE
              region.id_region = 
                        AND objects.arch=0
                        ORDER BY `objects`.`name` ASC