------------- EXCEPTION: RM::Exception::Database -------------
MSG: Unable to execute query:



		SELECT   Category.id AS container_id,
		         Category.full_name AS container_full_name,
		         'category' AS container_type,
		         Review.id AS id,
		         Review.thing_id AS thing_id,
		         LCASE( Review.thing_type ) AS thing_type,
		         Review.author_id AS author_id,
		         ReviewerRank.rank AS author_rank,
		         Author.known_as AS author_nickname,
		         Author.avatar_image AS author_avatar,
		         
		         Review.rating_id AS rating_id,
		         Review.volunteered_name AS volunteered_name,
		         Review.volunteered_location AS volunteered_location,
		         Review.volunteered_email AS volunteered_email,
		         Review.enable_emoticons AS enable_emoticons,
		         Review.keep_anonymous AS keep_anonymous,
		               YEAR(Review.date_submitted) AS review_year,
		              MONTH(Review.date_submitted) AS review_mon,
		              MONTH(Review.date_submitted) AS review_month,
		         DAYOFMONTH(Review.date_submitted) AS review_day,
		         Review.review_summary AS review_summary,
		         Review.review_pros AS review_pros,
		         Review.review_cons AS review_cons,
		         Review.review_text AS review_text,
		         Review.right_of_reply AS right_of_reply,
		         Review.was_helpful AS was_helpful,
		         Review.was_not_helpful AS was_not_helpful,
		       ( IF( Review.was_helpful, Review.was_helpful, 0 ) -
		         IF( Review.was_not_helpful, Review.was_not_helpful, 0 ) ) AS helpfulness
    , ReviewThing.custom_region AS custom_region , ReviewThing.custom_good_for_teenagers AS custom_good_for_teenagers , ReviewThing.custom_cabin_category AS custom_cabin_category , ReviewThing.custom_departure_port AS custom_departure_port , ReviewThing.custom_found_through AS custom_found_through , ReviewThing.custom_cruise_date AS custom_cruise_date , ReviewThing.custom_good_for_children AS custom_good_for_children , ReviewThing.custom_cabin_number AS custom_cabin_number ,
		         FORMAT( AVG(RatingValue.rating), 2 ) AS average_rating
            ,      Item.known_as AS known_as ,
			  Rating.rating_scale AS rating_scale,
			  CONCAT( Rating.rating_scale, '.00' ) AS rating_scale_float
		FROM
		          rq_Member AS Author,
        
		          rq_Item AS Item,
		          rq_Category AS Category,
		          rq_Category_Item AS Category_Item,
            
		          rq_Rating       AS Rating,
		          rq_RatingValue  AS RatingValue,
		          rq_Review       AS Review
		LEFT JOIN rq_ReviewerRank AS ReviewerRank
		       ON ReviewerRank.member_id = Review.author_id
		
		LEFT JOIN rq_ReviewItem AS ReviewThing
		       ON ReviewThing.review_id = Review.id
        

		/* for a given thing, retrieve a 'slice' of reviews */

		WHERE    Review.thing_id = ?                    /* reviews for the thing */
		AND      Review.thing_type = 'item'
		AND      Review.author_id = Author.id           /* to fully identify reviewer */
        
		AND      Item.id = Review.thing_id
		AND      Item.is_validated = 'Yes'
            
		AND      Review.is_approved = 'Yes'             /* only approved reviews from */
        
		AND      Category.id = ?                      /* thing in the current container */
            
		AND      Category.id = Category_Item.Category_id
		AND      Review.thing_id = Category_Item.Item_id
		AND      Rating.container_id = Category.id    /* lodged in current container */
		AND      Review.rating_id = RatingValue.rating_id
		AND      Rating.id = RatingValue.rating_id      /* where the review was */

		

		GROUP BY id
		HAVING   average_rating > 0    /* with non-null filtered rating */
		ORDER BY Review.timestmp DESC
		LIMIT    ?, ?
        

Reason: 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 '' at line 77.
STACK: Error::throw
STACK: RM::Base::throw /var/www/cgi-bin/reviews/_lib/RM/Base.pm:451
STACK: RM::DB::Base::do_query /var/www/cgi-bin/reviews/_lib/RM/DB/Base.pm:347
STACK: RM::DB::Base::do_fetch /var/www/cgi-bin/reviews/_lib/RM/DB/Base.pm:255
STACK: Foundry::fetch_hash_review_slice /var/www/cgi-bin/reviews/foundry/do/admin/Foundry/Fetch/Review.pm:378
STACK: Foundry::Thing::ListReviews::_init /var/www/cgi-bin/reviews/foundry/do/admin/Foundry/Thing/ListReviews.pm:97
STACK: Foundry::Thing::ListReviews::new /var/www/cgi-bin/reviews/foundry/do/admin/Foundry/Thing/ListReviews.pm:59
STACK: Foundry::Thing::_get_ordered_reviews /var/www/cgi-bin/reviews/foundry/do/admin/Foundry/Thing.pm:1197
STACK: Foundry::Thing::_init /var/www/cgi-bin/reviews/foundry/do/admin/Foundry/Thing.pm:581
STACK: Foundry::Thing::handler /var/www/cgi-bin/reviews/foundry/do/admin/Foundry/Thing.pm:109
STACK: Foundry::_init /var/www/cgi-bin/reviews/foundry/do/admin/Foundry.pm:199
STACK: Foundry::handle /var/www/cgi-bin/reviews/foundry/do/admin/Foundry.pm:47
--------------------------------------------------------------