第一个页面
<html>
<body>
<a href="q.html">A</a>
</body>
</html>下面要求写出q.html的页面,该页面按首写字母能提取数据库中的信息!!具体要实现在前一个页面点击大写字母 A 得到书库中的一大写字母A为开头数据库信息!前提是我数据库中的信息已经固定了,有300多条!(请不要告诉我在数据库中设置A的字段)懂的高手帮我个忙,请写出写出完整的页面!谢谢!!
<html>
<body>
<a href="q.html">A</a>
</body>
</html>下面要求写出q.html的页面,该页面按首写字母能提取数据库中的信息!!具体要实现在前一个页面点击大写字母 A 得到书库中的一大写字母A为开头数据库信息!前提是我数据库中的信息已经固定了,有300多条!(请不要告诉我在数据库中设置A的字段)懂的高手帮我个忙,请写出写出完整的页面!谢谢!!
这样吗
我们都是年轻人,我们都对编程感兴趣.
我都有上进心,我们要进步,我们要充实自己.
因为我们年轻,所以我们都有资本.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<!-- 引入jQuery -->
<script src="../scripts/jquery-1.3.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("#filterName").keyup(function(){
$("table tbody tr")
.hide()
.filter(":contains('"+( $(this).val() )+"')")
.show();
}).keyup();
})
</script>
</head>
<body>
<div>
<br/>
筛选:
<input id="filterName" />
<br/></div><table>
<thead>
<tr><th>姓名</th><th>性别</th><th>暂住地</th></tr>
</thead>
<tbody>
<tr><td>张山</td><td>男</td><td>浙江宁波</td></tr>
<tr><td>李四</td><td>女</td><td>浙江杭州</td></tr>
<tr><td>王五</td><td>男</td><td>湖南长沙</td></tr>
<tr><td>找六</td><td>男</td><td>浙江温州</td></tr>
<tr><td>Rain</td><td>男</td><td>浙江杭州</td></tr>
<tr><td>MAXMAN</td><td>女</td><td>浙江杭州</td></tr>
<tr><td>王六</td><td>男</td><td>浙江杭州</td></tr>
<tr><td>李字</td><td>女</td><td>浙江杭州</td></tr>
<tr><td>李四</td><td>男</td><td>湖南长沙</td></tr>
</tbody>
</table></body>
</html>在jquery中有个contains这个方法来过滤
begin
case WORD(hzchar[1])shl(8)+WORD(hzchar[2]) of
$B0A1..$B0C4 : result:= 'A ';
$B0C5..$B2C0 : result:= 'B ';
$B2C1..$B4ED : result:= 'C ';
$B4EE..$B6E9 : result:= 'D ';
$B6EA..$B7A1 : result:= 'E ';
$B7A2..$B8C0 : result:= 'F ';
$B9C1..$B9FD : result:= 'G ';
$B9FE..$BBF6 : result:= 'H ';
$BBF7..$BFA5 : result:= 'J ';
$BFA6..$C0AB : result:= 'K ';
$C0AC..$C2E7 : result:= 'L ';
$C2E8..$C4C2 : result:= 'M ';
$C4C3..$C5B5 : result:= 'N ';
$C5B6..$C5BD : result:= 'O ';
$C5BE..$C6D9 : result:= 'P ';
$C6DA..$C8BA : result:= 'Q ';
$C8BB..$C8F5 : result:= 'R ';
$C8F6..$CBF9 : result:= 'S ';
$CBFA..$CDD9 : result:= 'T ';
$CDDA..$CEF3 : result:= 'W ';
$CEF4..$D188 : result:= 'X ';
$D189..$D4D0 : result:= 'Y ';
$D4D1..$D7F9 : result:= 'Z ';
else
result:=char(0);
end;
end;
而且这个函数应该放在那里?
--假设这就是你的汉字转换为拼音的函数
create function funcChangeToPinYin(@columnName nvarchar(20))
returns nvarchar(20)
as begin
declare @msg nvarchar(20)
if @columnName='张三'
set @msg = 'Zhangsan'
return @msg
end
那么你执行的SQL就是这样:
select * from 表名 where funcChangeToPinYin(列名) like 'Z%'
这样就查询出拼音以Z开头的记录了
select ID, 姓名, 性别, 年龄 from tb where TForm1.GetPY(姓名)='A'
http://topic.csdn.net/u/20090918/20/bfe8cf06-9e5e-4e01-a1c9-c44fe7a76e63.html