How to link a word comprised of a custom field with another?

According to the documentation, you should display a field like:

<p><?php the_field('field_name'); ?></p>

Change your get_field to the_field:

<span class="c_f"><a href="https://wordpress.stackexchange.com/questions/131004/<?php the_field("field2_link'); ?>"><?php the_field('field1_details'); ?></a></span>

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