Post title as link parameter

I think this is what you are trying to accomplish?

$html .="<a id='test' rel="nofollow" href="https://example.com/cars/?aff="". echo get_the_title( $post_id ) ." target="_blank">";

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