Update $wpdb query with AJAX

You need the function accessible to the AJAX hook when it’s fired, so move the get_states_by_ajax_callback function to your functions.php

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