MYSQL ERROR
Error:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' IF(UNIX_TIMESTAMP(DATE_ADD(`T1`.`HighlightDate`, INTERVAL `TMH`.`Days` HOUR)...' at line 1
Query:SELECT SQL_CALC_FOUND_ROWS IF (FIND_IN_SET('91', `T1`.`Crossed`) > 0, 1, 0) AS `Crossed_listing`, `T1`.*, `T3`.`Key` AS `Key`, `T3`.`Type` AS `Listing_type`, `T3`.`Parent_keys`, `T3`.`Parent_IDs`, `T3`.`Path` AS `Path`, IF (`T1`.`country` = 'countries_finland' , 1, 0) AS `mf_filter_match`, IF(`T1`.`Featured_date` AND `T1`.`country` = 'countries_finland' , 0, (3956 * 2 * ASIN(SQRT(POWER(SIN((60.1717 - `T1`.`Loc_latitude`) * 0.0174532925 / 2), 2) + COS(60.1717 * 0.0174532925) * COS(`T1`.`Loc_latitude` * 0.0174532925) * POWER(SIN((24.9349 - `T1`.`Loc_longitude`) * 0.0174532925 / 2), 2))))) AS `mf_distance`, , IF(UNIX_TIMESTAMP(DATE_ADD(`T1`.`HighlightDate`, INTERVAL `TMH`.`Days` HOUR)) > UNIX_TIMESTAMP() AND `T1`.`HighlightDate` != '0000-00-00 00:00:00', '1', '0') as 'is_highlighted', (SELECT GROUP_CONCAT(`TR`.`Rate`, '=', `TR`.`Price`) AS `Rate_prices` FROM `fl_escort_rates` AS `TR` WHERE `T1`.`ID` = `TR`.`Listing_ID`) AS `Escort_Rates`, IF(`T1`.`Featured_date`, '1', '0') `Featured` FROM `fl_listings` AS `T1` LEFT JOIN `fl_categories` AS `T3` ON `T1`.`Category_ID` = `T3`.`ID` LEFT JOIN `fl_monetize_plans` AS `TMH` ON `T1`.`Highlight_Plan` = `TMH`.`ID` WHERE `T1`.`Status` = 'active' AND (`T1`.`Category_ID` = '91' OR (FIND_IN_SET('91', `T1`.`Crossed`) > 0) OR FIND_IN_SET('91', `T3`.`Parent_IDs`) > 0 ) AND `T1`.`Sub_status` <> 'invisible' AND ((`T1`.`country` = 'countries_finland') OR (3956 * 2 * ASIN(SQRT( POWER(SIN((60.1717 - `T1`.`Loc_latitude`) * 0.0174532925 / 2), 2) + COS(60.1717 * 0.0174532925) * COS(`T1`.`Loc_latitude` * 0.0174532925) * POWER(SIN((24.9349 - `T1`.`Loc_longitude`) * 0.0174532925 / 2), 2))) <= 310.68559611867)) ORDER BY `mf_filter_match` DESC, `mf_distance` ASC, `Featured` DESC , `T1`.`full_name` ASC LIMIT 0, 16
Function:getListings
Class:rlListings
File:/home/missdiamonds/escort.missdiamonds.com/includes/controllers/listing_type.inc.php (line# 397)