Get next and prev item from custom WP_Query and Custom Post Type

Are you maybe looking for something like this?

/**
* Outputs blog / archive pagination
*
*/
function my_pagination(){
    global $wp_query;

    $total_pages = $wp_query->max_num_pages;

    if ($total_pages > 1):
        $current_page = max(1, get_query_var('paged'));
        echo paginate_links(array(
            'current' => $current_page,
            'total' => $total_pages,
            'prev_text' => 'Prev',
            'next_text' => 'Next',
            'type' => 'list'
        ));
    endif;

}

Then include it in your theme likeso

<?php if ( $family_query->have_posts() ) : ?>
<?php while ( $family_query->have_posts() ) : ?>
    <?php $family_query->the_post(); ?>
    <h3><?php echo esc_attr( get_the_title() ); ?></h3>
<?php endwhile; ?>

<?php my_pagination(); ?>

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