jQuery script is not working inside ‘head’ tag

If your script depends on jQuery, you have to declare that dependency to make sure WordPress will enqueue it earlier than yours.

wp_enqueue_script( 
    'my-jquery-script', 
    get_stylesheet_directory_uri() . '/js/my-jquery-script.js',
    [ 'jquery' ] /* declare the dependency */
);

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