单击链接时显示我的SQL查询

I have a "Members" page that displays my organizations members info via My SQL. Currently, the database displays "State" quick links at the top and has the members organized by State down the page. If you click on one of the State links at the top, it will navigate to the section of the page with that state and associated members. I want the members associated with a specific state to be displayed only once I click the associated state link -- instead of all of the information showing at once like it is now. The page I am referring to can be seen at this link: http://homesforhorses.dreamhosters.com/members/

  $display_members .= "<br /><br />";

  $entries[$row['country']][$row['state_name']][] = $display_members;
}

$countrylinks = false;
$statelinks   = false;
$display      = false;



if(is_array($entries)){
    $display .= '
    <div class="memberlist">';
    foreach($entries as $country=>$state_members){
        $countrylinks .= '<a href="#'.$country.'">'.$country.'</a> &nbsp;&nbsp;&nbsp;';

        $display .= '
        <h2 id="'.$country.'">'.strtoupper($country).'</h2>
        <div class="country">';


        if(($state_members)){
            foreach($state_members as $state=>$members){
               $statelinks .= '<a href="#'.$state.'">'.$state.'</a> ';

                $display .= '
                <h3 id="'.$state.'">'.strtoupper($state).'</h3>
                <div class="state">';
                if(is_array($members)){
                    foreach($members as $key=>$member){
                        $display .= '
                        <div class="member">
                            '.$member.'
                        </div>';
                    }
                }
                $display .= '
                </div>';//state
            }
        }
        $display .= '
        </div>';//country
    }
    $display .= '
    </div>';
}
$statelinks1 = '
<h2>Members List</h2>
<strong>Quick Links</strong><br /><br />
'.$statelinks.'<br /><br />
'$display;


return $statelinks1; }

Thank you in advanced for your help! I am grateful for anyone even looking at it.

I would have all the information in hidden blocks in the CSS code. Then when you click the link, have an onclick javascript that unhides the block of information you want to show.