当前位置:首页 » 操作系统 » 数据库级联菜单

数据库级联菜单

发布时间: 2022-03-05 18:36:03

A. sql级联查询 商品类型级联菜单查询

就是几个表单的联合查询,不难的。所有关联字段link起来就好了。因为你的问题里面就讲到了关联的字段,无法给出具体的sql语句。你可以hi我,告诉你详细的操作

B. 二级联动菜单,从数据库中读取,并显示相应的值。该怎么写

二级别联动菜单建议使用ajax写。

C. 怎样与SQL数据库连接用ASP做一个三级联动菜单

建一个表fenlei,包括字段如下:
id,name,level,follow

id为标识[自动编号]
name为分类名称[字符]
level为分类级别[数字,不可为空]
follow为从属于哪个分类[数字,默认为0]

假设表中内容为:
id | name | level | follow
1 | biga | 1 | 0
2 | bigb | 1 | 0
3 | sa | 2 | 1
4 | ssa | 3 | 3

sql="select * from fenlei where level = 1 and follow =0"
set rs=conn.execute(sql)
do while not rs.eof
response.write rs("id")&"."&rs("name")&"<br>"
sql1="select * from fenlei where level = 2 and follow = "&rs("id")
set rs1=conn.execute(sql)
do while not rs1.eof
response.write rs("id")&"."&rs1("id")&"."&rs1("name")&"<br>"
sql2="select * from fenlei where level = 3 and follow = "&rs1("id")
rs2=conn.execute(sql)
do while not rs2.eof
response.write rs("id")&"."&rs1("id")&"."&rs2("id")&"."&rs2("name")&"<br>"
rs2.movenext
loop
rs1.movenext
loop
rs.movenext
loop

注:conn为数据库连接
以上三个循环掌握住了以及数据库中各记录的关系掌握了就没有大问题了,具体代码的问题请参考你的教科书。哦呵呵呵~

D. 动态级联菜单怎么实现的

方法1: 用Css实现
<html>
<head>
<title>css菜单显示效果</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
/**
*菜单的构造,需要绑定到onload
*/
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
</script>
<style type="text/css" media="all">
/**
子乌的叶子css:主样式表
这个样式表的结构参考了<a href="http://www.zeldman.com">zeldman</a>的样式表结构
update:05.11.18
author:sheneyan
*/

html {min-width: 742px;}

/*css基本规则*/
img{border:0;}
p.access {display:none;}
div#counters{display:none;}/*计数器暂时不显示*/
a{text-decoration: none;}
/* 主要布局 */
body{
overflow:auto;
text-align: center;
margin: 0 auto;
padding: 0;
border: 0;
background: #fff;
color: #000;
font: small/18px "宋体", Verdana, Helvetica, sans-serif;
}
/**菜单的控制,根据<a href="http://www.alistapart.com/d/horizdropdowns/horizontal2.htm">css 菜单</a>修改而来*/
ul#nav,ul#nav ul{
margin: 0 auto;
text-align:left;
padding: 0;
list-style: none;
background:#fff;
z-index:99;
}
ul#nav {
width:732px;
display:block;
height:24px;
clear:both;
}

ul#nav li {
position: relative;
z-index:999;
float:left;
}
ul#nav ul li{
display:block;
}
ul#nav ul {
width:100px;
height:auto;
position: absolute;
text-align:left;
left: 0px;
display: none;
border:solid 1px #697210;
}

/*当鼠标在子菜单和父菜单上时,父菜单的样式*/
ul#nav li.over a,ul#nav li:hover a{
border-color:#E2144A;
background: #fdd;
font-weight:bold;
color: #E2144A;
}
/*将子菜单的样式清除*/
ul#nav li.over ul a,ul#nav li:hover ul a{
background:#fff;
font-weight:normal;
color:#777;
}
/*子菜单的hover样式*/
ul#nav li.over ul a:hover,ul#nav li:hover ul a:hover{
background:#fff;
font-weight:normal;
color: #E2144A;
background: #fdd;
border-color:#E2144A;
font-weight:bold;
}

/* Styles for Menu Items */
ul#nav a {
font-size:14px;
line-height:17px;
display: block;
padding:0 0 0 10px;
width:78px;
color: #777;
height:17px;
background: #fff;
border-left:solid 1px #fff;
border-top:solid 1px #fff;
border-right:solid 1px #fff;
border-bottom:solid 5px #697210;
}

ul#nav ul li{
width:100px;
border:0;
}
/* Fix IE. Hide from IE Mac \*/
* html ul#nav li { float: left; height: 17px; }
* html ul#nav li a { height: 17px; }
/* End */

ul#nav ul a { padding: 2px 0px 2px 10px;border:0;width:90px; } /* Sub Menu Styles */

ul#nav li:hover ul,ul#nav li.over ul { display: block; } /* The magic */
</style>
<body>
测试css菜单显示效果<br/>
<!--菜单开始-->
<ul id='nav'>
<li><a href='/g.php/working.html'>文章</a>
<ul>
<li><a href='/g.php/working/29.html'>随笔</a></li>
<li><a href='/g.php/working/30.html'>小说</a></li>
<li><a href='/g.php/working/31.html'>诗</a></li>
<li><a href='/g.php/working/32.html'>文摘</a></li>
</ul>
</li>
<li><a href='/g.php/pic.html'>美图</a>
<ul>
<li><a href='/g.php/pic/19.html'>漫画</a></li>
<li><a href='/g.php/pic/20.html'>摄影</a></li>
<li><a href='/g.php/pic/33.html'>CG作品</a></li>
<li><a href='/g.php/pic/41.html'>图+文</a></li>
</ul>
</li>
<li><a href='#'>技术</a>
<ul>
<li><a href='/g.php/tech/tool/37.html'>在线工具</a></li>
<li><a href='/g.php/tech/collect/43.html'>代码收集</a></li>
<li><a href='/g.php/tech/lab/44.html'>实验室</a></li>
<li><a href='/g.php/tech/article/45.html'>技术文章</a></li>
</ul>
</li>
<li><a href='/g.php/fav.html'>网站收藏夹</a></li>
<li><a href='/g.php/working.html'>读书笔记</a>
<ul>
<li><a href='/g.php/working/22.html'>哲学</a></li>
<li><a href='/g.php/working/23.html'>小说</a></li>
</ul>
</li>
<li><a href='/g.php/working.html'>日记</a>
<ul>
<li><a href='/g.php/working/27.html'>生活</a></li>
<li><a href='/g.php/working/28.html'>工作</a></li>
</ul>
</li>
<li><a href='#'>计划</a>
<ul>
<li><a href='/g.php/todo/39.html'>计划要做的事</a></li>
<li><a href='/g.php/tobuy/40.html'>计划要买的</a></li>
</ul>
</li>
<li><a href='/g.php/working.html'>其他</a>
<ul>
<li><a href='/g.php/working/34.html'>关于本站</a></li>
<li><a href='/g.php/working/35.html'>留言</a></li>
<li><a href='/g.php/working/36.html'>友情链接</a></li>
</ul>
</li>
</ul><!--菜单结束-->
</Html>

E. 3级级联菜单,国家。省份。城市。必须在SQL一个表中实现。我这样写的数据库对吗

这样写也是OK的,看你怎么用吧。
还有一种写法叫Hierarchical,使用递归方法。具体参见https://en.wikipedia.org/wiki/Hierarchical_and_recursive_queries_in_SQL

F. asp数据库联动菜单

补充一下:你的数据库结构好像有问题
以前我在经典发过一个

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" src="selectarea.js"></script>
<title>蓝木设计——省市县三级地名数据库自动联动系统</title>
</head>

<body>
<select name="city1" id="city1" onChange="changepro('city2','city1');">
<option value="" selected>省/直辖市</option>
<%
Set Rs = GetRs("select code,b_class from class")
while not Rs.eof
Response.Write "<option value='" & Rs(0) & "'>" & Rs(1) & "</option>"
Rs.movenext
wend
Rs.Close
Set Rs = nothing
%>
</select>
<select name="city2" id="city2" onChange="changecity('city3','city2');">
<option value="">请选择</option>
</select>
<select name="city3" id="city3">
<option value="">请选择</option>
</select>
</body>
</html>

<script>
var lmcount;
var lmcount2;
lm=new Array();
lm2=new Array();
<%
i=0
Set Rs = GetRs("select m_class from class")
while not Rs.eof
Set Rs1 = GetRs("select s_class from class where 属于上面中类的小类"
while not Rs1.eof
Response.Write "lm[" & i & "] = new Array('" & Rs1(0) & "','" & Rs(0) & "')"
Rs1.movenext
wend
count1 = Rs1.Recordcount
Rs1.Close
Set Rs1 = nothing
wend
count2 = Rs2.Recordcount
Rs.Close
Set Rs = nothing
%>

lmcount=<%=count1%>;
lmcount2=<%=count2%>;
function changepro(city,pro)
{
var city=city;
var pro=document.getElementById(pro).value;
var i;
document.getElementById(city).length=1;
for (i=0;i<lmcount;i++){
if (lm[i][1]==pro){
document.getElementById(city).options[document.getElementById(city).length]=new Option(lm[i][0], lm[i][0]);
}
}

}

function changecity(county,city)
{
var county=county;
var city=document.getElementById(city).value;
var j;
document.getElementById(county).length=1;
for (j=0;j<lmcount2;j++){
if (lm2[j][1]==city){
document.getElementById(county).options[document.getElementById(county).length]=new Option(lm2[j][0], lm2[j][0]);
}
}

}
</script>

G. 怎样才能把三级联动下拉菜单的值提交到数据库有点急

这应该和联动没关系吧,获取到页面上选择年,月,日的值和省,市,区的值拼一起写入到数据库的birthday和address应该就可以了吧。

H. 什么是级联式菜单

比如:开始菜单里面有程序菜单,他下里面又有附件菜单,附件又有系统工具等,这就是一个四级级联菜单

I. MVC框架设计,我要做一个网上评教系统,关于题库管理时,数据库设计是这样的;想做个级联菜单,求高手指点

你的question_id记录的是ID编号吧,可以采用jquery或ext,很方便

热点内容
云电脑服务器限制 发布:2024-09-24 01:08:31 浏览:863
现在什么安卓手机打和平精英 发布:2024-09-24 00:48:29 浏览:946
银耳算法 发布:2024-09-24 00:36:52 浏览:77
ftp设置代理 发布:2024-09-24 00:36:50 浏览:279
查询数据库的名称 发布:2024-09-24 00:30:07 浏览:676
安卓盒子火棒神盾哪个好 发布:2024-09-24 00:29:34 浏览:661
java学生管理系统代码 发布:2024-09-23 23:57:43 浏览:921
mac电脑代理服务器要求输入用户名和密码 发布:2024-09-23 23:31:03 浏览:324
鸿蒙系统跟安卓到底有什么区别 发布:2024-09-23 23:01:48 浏览:8
php自动斜杠 发布:2024-09-23 23:01:45 浏览:98