dongzao9044 2014-10-10 01:47
浏览 50
已采纳

单击链接时显示我的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.

  • 写回答

1条回答 默认 最新

  • dongrong9938 2014-10-10 03:37
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题