wordpress prevent multiple shortcodes

Just remove the shortcode during the first call.

add_shortcode( 'foo', 'foo_shortcode_handler' );

function foo_shortcode_handler()
{
    remove_shortcode( 'foo' );
    return 'bar';
}

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