影响PHP+MYSQL执行速度的写法对比第7/7页
程序员文章站
2023-09-20 20:03:43
[code]
[code]<?php
include_once("../db.php");
if($_get[x2]==0 and $_get[x1]==0)
{
$t=" s1='' ";
}else
{
if($_get[x2]!=0)
{
$t=" x2='$_get[x2]' ";
}else
if($_get[x1]!=0)
{
$t=" x1='$_get[x1]' and x2=0 ";
}
}
$query = "select count(*) from ask_member where $t ";
$result2 = mysql_db_query($database, $query);
$r3 = mysql_fetch_array($result2);
$amount=$r3[0];
$page_size=5;
if($amount%$page_size==0 and $amount>0)
{
$pagecount=($amount/$page_size);
}else
{
$pagecount=intval($amount/$page_size)+1;
}
if($_get