get_query_var returns null

You have to add any query vars that are not WordPress objects to the array of recognized query vars to be able to retrieve it from the $wp_query global:

add_filter( 'query_vars', 'wpa66452_query_vars' );
function wpa66452_query_vars( $query_vars ){
    $query_vars[] = 'tree';
    return $query_vars;
}

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