|
发表于 2024-1-2 12:09
来自手机
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
手机demo参与一下
//select * from 课题统计表;
//select * from criteria_stu limit 20;
xli_add_php~~
?>
<h1>多条件综合查询</h2>
<?php
$frmSetup='criteria_stu';
$tblResult="课题统计表";
if(sizeof($_POST)==0){
\multiquery\g_ImportPhp('budget/formOrders');
formOrders($frmSetup);
}else{
$_POST=array_filter($_POST);
foreach ($_POST as $k=>$v){
if(preg_match('/^(.*)-(.*)/',$v,$m)){$where[]="(`$k` between ? and ?)"; $arrVals[]=$m[1]; $arrVals[]=$m[2];
$flds[]=$k;
}else{
$where[]="`$k` like ?";
$arrVals[]="%$v%";
$flds[]="replace(`$k`,'$v','<b>$v</b>') `$k`";
}
}
$w=implode(' and ',$where);
$f=implode(',',$flds);
$sql="SELECT *,$f FROM $tblResult where $w";
//echo $sql;
//echo implode('|',$arrVals);
$sth = $db->prepare($sql);
$sth->execute($arrVals);
$result = $sth->fetchAll();
\multiquery\g_ImportPhp('budget/arrayToTable');
arrayToTable($result);
}
~;
|
评分
-
1
查看全部评分
-
|