求php多条件搜索后分页代码

来源:百度知道 编辑:UC知道 时间:2024/05/11 05:13:15
代码如下:不知道如何更改
<?
include "search_dg/sql.php";

$page = empty($_GET['page']) ? 1 : intval($_GET['page']);

unset($_GET['page']);

$query_string_prefix = my_http_build_query($_GET);
$query_string_prefix = empty($query_string_prefix) ? '' : $query_string_prefix.'&';

$cond="where (1=1)";
if ($_GET["New"]!="") {$New=$_GET["New"];$cond="$cond and New LIKE '%$New%'";}
if ($_GET["Old"]!="") {$Old=$_GET["Old"];$cond="$cond and Old LIKE '%$Old%'";}
if ($_GET["Impedance1"]!="" or $_GET["Impedance2"]!="" ) {$Impedance1=$_GET["Impedance1"];$Impedance2=$_GET["Impedance2"];$cond="$cond and Impedance between $Impedance1 and $Impedance2";}
if ($_GET["FREQ"]!="") {$FREQ=$_GET

我看你代码都写好了的呀,只是引号使用不对,我给你修改如下:

for ($i=1; $i<$total_one; $i++) {
if ( $i == $page) echo "<a>$i</a>";
else echo "<a href='show_three.php?{$query_string_prefix}&page=$i'>$i</a>";
}

for ($i=1; $i<$total_one; $i++) {
if ( $i == $page) echo "<a>$i</a>";
else echo "<a href='show_three.php?{$query_string_prefix}&page=$i'>$i</a>";
}