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 'AND GROUP BY `d`.`id_hotel` ORDER BY `d`.`nombre` asc' at line 6

SELECT `d`.*, (SELECT im.imagen FROM tbl_galerias im WHERE im.keyobj = d.mykey ORDER BY id_galeria DESC LIMIT 1) as imagen, (SELECT min(th.precio) as minprecio FROM tbl_habitacion th WHERE th.id_hotel = d.id_hotel ORDER BY th.precio DESC LIMIT 1) as preciominimo, CEILING((SELECT sum(vt.punto) as sumpuntos FROM tbl_votosHotel vt where vt.id_hotel = d.id_hotel)/(SELECT count(vt.id_hotel) as totalVotos FROM tbl_votosHotel vt where vt.id_hotel = d.id_hotel)) as rating FROM (`tbl_hoteles` d) LEFT JOIN `tbl_hoteles_X_caracteristicas` hx ON `hx`.`id_hotel` = `d`.`id_hotel` LEFT JOIN `tbl_habitacion` hab ON `hab`.`id_hotel` = `d`.`id_hotel` WHERE `id_language` = 1 AND `hab`.`precio` BETWEEN AND GROUP BY `d`.`id_hotel` ORDER BY `d`.`nombre` asc

Filename: /home1/valladolid/public_html/models/Destinos/destinos_model.php

Line Number: 1801