Так вроде нашел баг, попробуйте такой код:
$get_a_ids = $wpdb->get_results("" . "SELECT achiev_id " . "FROM " . RCL_PREF . "achievement_stats " . "WHERE ID IN (SELECT MAX(ID) as ID " . "FROM " . RCL_PREF . "achievement_stats " . "WHERE user_id = $user_id " . "GROUP BY type " . "ORDER BY ID DESC )", ARRAY_A); if (!$get_a_ids) { return false; } foreach ($get_a_ids as $a) { $a_id_list[] = $a['achiev_id']; } $a_id_list = implode(',', $a_id_list); $get_a = $wpdb->get_results("" . "SELECT " . RCL_PREF . "achievement.*, " . RCL_PREF . "achievement_stats.date " . "FROM " . RCL_PREF . "achievement, " . RCL_PREF . "achievement_stats " . "WHERE " . RCL_PREF . "achievement.ID IN($a_id_list) " . "AND " . RCL_PREF . "achievement.ID = " . RCL_PREF . "achievement_stats.achiev_id " . "AND " . RCL_PREF . "achievement_stats.user_id = $user_id " . "ORDER BY date DESC, ID DESC " . "LIMIT $limit", ARRAY_A);
Тема закрыта. Публикация новых сообщений запрещена.