Ajax insert or update data

I’m not entirely sure you want to call exit at the end of that function, since exit terminates all further PHP execution. This is likely the cause of your troubles.

http://php.net/manual/en/function.exit.php

That said, you can always test for the result of your queries by setting a variable to be the result, and then sending that as your $response.

if ($row) {
    $qry_result = $wpdb->replace( 
        $table_name, 
        array( 
            'id' => $row->id,
            'user_id' => $user_id, 
            'course_id' => $xxx_course_id,
            'progress_percent' => $vimeo_percent,
            'seconds_played' => $vimeo_seconds
        ), 
        array( 
            '%d',
            '%d',
            '%f', 
            '%d' 
        ) 
    );
} else {
    $qry_result = $wpdb->insert( 
        $table_name, 
        array( 
            'user_id' => $user_id, 
            'course_id' => $xxx_course_id,
            'progress_percent' => $vimeo_percent,
            'seconds_played' => $vimeo_seconds
        ), 
        array( 
            '%d',
            '%d',
            '%f', 
            '%d' 
        ) 
    );
}

if( false !== $qry_result ) {
    $qry_result = true;
}

$response = array( 'success' => $qry_result, 'data' => 'hello' ); //if $data is set
wp_send_json_success( $response );

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