$searchname=$_POST['sousuo'];//获得搜索关键字
if(!isset($searchname))
{
echo "<script>location.href='index.php';</script>";
}
$typename=$_POST['type'];
$shijian=$_POST['rboname'];
$xitongshijian=date("Y-m-d");//获得系统当前时间
$jianyitian=date('Y-m-d H:i:s',strtotime("$a-1 day"));//减去一天时间
$jiansantian=date('Y-m-d',strtotime("$a-3 day"));//减去三天时间
$jianqitian=date('Y-m-d',strtotime("$a-7 day"));//减去7天时间switch($typename)
{
case "职位名":
if($shijian=="")
{
$tiaojian="Shenhe=1 and Gzxx like '%".$searchname."%' order by Adddate desc";
}
else if($shijian=="近一天")
{
$tiaojian="Shenhe=1 and Gzxx like '%".$searchname."%' and Adddate between '".$jianyitian."' and '".$xitongshijian."' order by Adddate desc";
}
else if($shijian=="近三天")
{
$tiaojian="Shenhe=1 and Gzxx like '%".$searchname."%' and Adddate between '".$jiansantian."' and '".$xitongshijian."' order by Adddate desc";
}
else if($shijian=="近一星期")
{
$tiaojian="Shenhe=1 and Gzxx like '%".$searchname."%' and Adddate between '".$jianqitian."' and '".$xitongshijian."' order by Adddate desc";
}
break;
case "工作时间":
if($shijian=="")
{
$tiaojian="Shenhe=1 and Gzsj like '%".$searchname."%' order by Adddate desc";
}
else if($shijian=="近一天")
{
$tiaojian="Shenhe=1 and Gzsj like '%".$searchname."%' and Adddate between '".$jianyitian."' and '".$xitongshijian."' order by Adddate desc";
}
else if($shijian=="近三天")
{
$tiaojian="Shenhe=1 and Gzsj like '%".$searchname."%' and Adddate between '".$jiansantian."' and '".$xitongshijian."' order by Adddate desc";
}
else if($shijian=="近一星期")
{
$tiaojian="Shenhe=1 and Gzsj like '%".$searchname."%' and Adddate between '".$jianqitian."' and '".$xitongshijian."' order by Adddate desc";
}
break;
}
$sql="select Wor_id,Gzxx,Zprs,Gzsj,Gzyq,Daiyu,Adddate,jipin from ".PREFIX."wor where ".$tiaojian."";我的搜索条件有点多 但是最后搜索条件都保存在一个变量里$tiaojian ,现在遇到不会搜索后分页了 ,请高手 教教 写出详细代码 谢谢拉
急
if(!isset($searchname))
{
echo "<script>location.href='index.php';</script>";
}
$typename=$_POST['type'];
$shijian=$_POST['rboname'];
$xitongshijian=date("Y-m-d");//获得系统当前时间
$jianyitian=date('Y-m-d H:i:s',strtotime("$a-1 day"));//减去一天时间
$jiansantian=date('Y-m-d',strtotime("$a-3 day"));//减去三天时间
$jianqitian=date('Y-m-d',strtotime("$a-7 day"));//减去7天时间switch($typename)
{
case "职位名":
if($shijian=="")
{
$tiaojian="Shenhe=1 and Gzxx like '%".$searchname."%' order by Adddate desc";
}
else if($shijian=="近一天")
{
$tiaojian="Shenhe=1 and Gzxx like '%".$searchname."%' and Adddate between '".$jianyitian."' and '".$xitongshijian."' order by Adddate desc";
}
else if($shijian=="近三天")
{
$tiaojian="Shenhe=1 and Gzxx like '%".$searchname."%' and Adddate between '".$jiansantian."' and '".$xitongshijian."' order by Adddate desc";
}
else if($shijian=="近一星期")
{
$tiaojian="Shenhe=1 and Gzxx like '%".$searchname."%' and Adddate between '".$jianqitian."' and '".$xitongshijian."' order by Adddate desc";
}
break;
case "工作时间":
if($shijian=="")
{
$tiaojian="Shenhe=1 and Gzsj like '%".$searchname."%' order by Adddate desc";
}
else if($shijian=="近一天")
{
$tiaojian="Shenhe=1 and Gzsj like '%".$searchname."%' and Adddate between '".$jianyitian."' and '".$xitongshijian."' order by Adddate desc";
}
else if($shijian=="近三天")
{
$tiaojian="Shenhe=1 and Gzsj like '%".$searchname."%' and Adddate between '".$jiansantian."' and '".$xitongshijian."' order by Adddate desc";
}
else if($shijian=="近一星期")
{
$tiaojian="Shenhe=1 and Gzsj like '%".$searchname."%' and Adddate between '".$jianqitian."' and '".$xitongshijian."' order by Adddate desc";
}
break;
}
$sql="select Wor_id,Gzxx,Zprs,Gzsj,Gzyq,Daiyu,Adddate,jipin from ".PREFIX."wor where ".$tiaojian."";我的搜索条件有点多 但是最后搜索条件都保存在一个变量里$tiaojian ,现在遇到不会搜索后分页了 ,请高手 教教 写出详细代码 谢谢拉
急
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货