全选和筛选以及⽐较好⽤的sql语句⾼级查询查询[条件并列⽤and]
select * from required where xuenian like '%年%' and teachercode=01 order by starttime limit 0,2
修改同时修改两个数据【数据使⽤逗号隔开】
update required set teachercode = 02 ,majorcode = '201702' where ids = 5
select major,count(*) from class where 1=1 group by major //分组查询
5.4
<?php
queryselectorall用法$tt="sssss,ssrsss";
$t = explode(",", $tt);
$shuZ='';
foreach($t as $v)
{
$shuZ.=" name like '%".$v."%' or";
}
$str = substr($shuZ,0,strlen($shuZ)-2);
echo $str;
var_dump($t);
$r = count($t);
var_dump($r);//数组长度
>
拼接查询语句
View Code
全選和選刪按鈕選中的放到數組裏⾯
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="../fenye/jquery-1.11.2.min.js"></script>
</head>
<body>
<input type="checkbox" id="aaa" />
<input type="checkbox" name="sss" a='s' />1
<input type="checkbox" name="sss" a='m'/>2
<input type="checkbox" name="sss" a='n'/>3
<input type="checkbox" name="sss" a='k'/>4
</body>
<script>
$("#aaa").click(function(){
if($(this).prop("checked")==true)
{
$("[name='sss']").prop("checked",true);
var chang = $("input[name='sss']:checked");
var shuzu = new Array();
for(var i =0;i<chang.length;i++)
{
shuzu[i]=chang.eq(i).attr("a");
}
alert(shuzu);
}
else
{
$("[name='sss']").prop("checked",false);
}
})
</script>
</html>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论