Do I need to use wp_reset_postdata for my function?

Yes you should, otherwise you could interfere with another query happening on the same page.

Using $the_query->the_post(); interferes with the global $post variable, and wp_reset_postdata() serves that exact purpose, to reset the global $post variable to the original (global) query. Read more

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