adding a #hash to each link in list_pages()?

I”d wrap it in a function (save it in functions.php);

function wp_list_pages_with_hash( $hash, $args="" )
{
    $add_hash = create_function( '$link', 'return $link . "#' . $hash . '";' );
    add_filter( 'page_link', $add_hash );
    $result = wp_list_pages( $args );
    remove_filter( 'page_link', $add_hash );
    return $result; // back compat in case 'echo' was null  
}

Then call it like so!

<?php wp_list_pages_with_hash( 'target', 'title_li=&depth=0' ); ?>

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