Pass results of custom query to loop – when writing a plugin

Found the correct hook to use. This intercepts the query and lets me modify it for my own purposes:

add_filter('posts_request', 'changeQuery');

function changeQuery($query) {
  $query = 'my new sql query here';
  return $query;
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)