I am attempting to use shortcodes for any reference function. The function connects to some database, queries the term and returns the meaning.

Presently, it really works basically use self-closing shortcodes.

For instance:

    function defineGlossary($atts) {
    extract(shortcode_atts(array(
    'term' => '0'
    ), $atts));

    // connect to database and grab definition

    $glossary_output .= "<span title='";
    $glossary_output .= $result_definition;
    $glossary_output .= "'>";
    $glossary_output .= $term;
    $glossary_output .= "</span>";
    return $glossary_output;
    }
    add_shortcode("glossary", "defineGlossary");

[reference="administrator"] like a shortcode is effective with this particular code. It returns

    <span title="definition pulled from the database">administrator</span>.

I'd would rather make use of an attaching shortcose for example [reference]administrator[/reference] Regrettably, I am unable to get this work since I'm not sure how (or maybe it is possible) to pass through the $content like a variable (to transmit towards the database and discover the meaning).

Update from below. Basically simplify it to:

    <?php
    function defineGlossary($atts, $shortcodeContent = null) {
    $glossary_output .= "<span title='";
    $glossary_output .= "Sample Definition";
    $glossary_output .= "'>";
    $glossary_output .= $shortcodeContent;
    $glossary_output .= "</span>";
    return $glossary_output;
    }
    add_shortcode("glossary", "defineGlossary");
    ?>

And employ [reference]administrator[/reference] it simply returns [reference]administrator within the content.

Just give a second variable for your function to handle shortcode content. This is passed along whether it is available.

 function defineGlossary($atts, $shortcodeContent = null) {

  if (is_null( $content )) { //handle if shortcode isn't defined 
 }

// connect to database and grab definition
$glossary_output .= "<span title='";
$glossary_output .= $result_definition;
$glossary_output .= "'>";
$glossary_output .= $shortcodeContent;
$glossary_output .= "</span>";
return $glossary_output;
}
add_shortcode("glossary", "defineGlossary");

I did not test this, but It does what you would like.