Number of eligible queries under php7.0

<?php @session_start();?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php if($_SESSION["uid"]==""){echo "<script>alert(",!");window.location.href="../login.php";</script>";exit;}
require_once("../../func/dbase.php");
error_reporting(E_ALL ^ E_NOTICE);
?>
<title></title>
<?php
  $end= 0;
  $countPage = 0;
  $count = 0;
  $page = 0;
  $result =0;
  $end = 0;
  $classid = 0;
  $page = $_GET["page"];
  if($page==""){$page=1;}
  $torul = 20;
  $start = $page * $torul - $torul;
  $id = "";
  $re = 0;
  $id = $_GET["id"];
    $key = $_POST["key"];
   $lei = $_POST["lei"];
  if($id!=""){
      $sql="select id,url from down where id=".$id;
    $result = $mysqli->query($sql);
    while($rs=mysqli_fetch_array($result)){unlink("../../down/$rs[1]");}
    $sql = "delete from down where id =".$id;
    $result = $mysqli->query($sql);
    if($re!=0){
       echo "<script>window.location =index.php?page=".$page."</script>";
    }
  }
if($_REQUEST["act"]=="delall"){
$yy=$_REQUEST["xx"];
for($i=0;$i<count($yy);$iPP){
$sql="select id,url from down where id=".$yy[$i];
$result = $mysqli->query($sql);
while($rs=mysqli_fetch_array($result)){unlink("../../down/$rs[1]");}
$sql= "delete from down where id=".$yy[$i];
$result = $mysqli->query($sql);}
echo "<script>window.location.href="index.php?page=$page";</script>";
exit;}?>

<style type="text/css">
<!--
td {
    font-size: 12px;
}
-->
</style>
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    background-color: -sharp007EC0;
}
-->
</style>
<script language="javascript">
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;iPP)
    {
    var e = form.elements[i];
    if (e.name != "chkall")
       e.checked = form.chkall.checked;
    }
}
</script>
</head>
<body>
<table width="0" height="28" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" height="48"><img src="../images/44_1.jpg" width="10" height="48" alt="" /></td>
    <td background="../images/44_2.jpg"><span style="font-size:16px">>></span></td>
    <td width="11"><img src="../images/44_4.jpg" width="11" height="48" alt="" /></td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" height="36"><img src="../images/44_5.jpg" width="10" height="36" alt="" /></td>
    <td background="../images/44_6.jpg"></td>
    <td width="11"><img src="../images/44_8.jpg" width="11" height="36" alt="" /></td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" height="450" background="../images/44_9.jpg"></td>
    <td valign="top" bgcolor="-sharpFFFFFF">
<form name="form1" method="post" action="index1.php">
        <table width="560" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr><td></td></tr></table>
        <table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="193" height="25">
              <input name="key" type="text" id="key" value="<?php echo $key?>" size="20" maxlength="30"></td>
            <td width="214" align="center"><select name="lei">
                <option value="0">------</option>
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
              </select>
            </td>
            <td width="153" valign="bottom">
                <input type="submit" name="Submit" value=" " style="width:60px; height:25px;"></td>
          </tr>
        </table>
      </form>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="-sharpf8f8f8" style="border:1px solid -sharp3366dd">
  <form name="form1" action="index.php" method="post">
  <tr>
    <td width="94" height="30" align="center"  >/
    <input type="checkbox" id="chkall" name="chkall" value="on" onClick="CheckAll(this.form)"></td>
    <td width="555" align="left"  ></td>
    <td width="98" align="center"  ></td>
    <td width="101" align="center"  ></td>
    <td colspan="2" align="center" ></td>
  </tr>
   <?php
     $sql = "select id,title,left(sdate,10) sdate,lei from down";
     if($key!=""){
     $sql= $sql." and  title like "%".$key."%"";
     }
     if($lei>0){
             $sql = $sql." and lei = ".$lei;
     }
     $sql = $sql." order by id desc";
     $sql = $sql." limit ".$start.",".$torul;
          
     $result = $mysqli->query($sql);
     while($ar=mysqli_fetch_row($result)){$count =  $ar[0];}

    $result = $mysqli->query($sql);
    if($count<$torul&&$count>0){$page = 1;}

    if(($count%$torul)==0){
        $countPage = intval($count/$torul);
    } else {
        $countPage = intval($count/$torul) +1;
    }
     if($result!=0){
        while($arr=mysqli_fetch_array($result)){
        $iPP;
        if($i%2==0){$bg="-sharpf5f5f5";}
        else{$bg="-sharpffffff";}?>
   <tr>
    <td width="94" height="22" align="center" bgcolor="<?php echo $bg;?>"><input type="checkbox" name="xx[]" value="<?php echo $arr[0];?>"></td>
    <td height="22" align="left" bgcolor="<?php echo $bg;?>"><?php echo $arr[1]?></td>
    <td height="22" align="center" bgcolor="<?php echo $bg;?>">
    <?php if($arr[3]==1){?><?php }?>
    <?php if($arr[3]==2){?><?php }?>
    <?php if($arr[3]==3){?><?php }?></td>
    <td align="center" bgcolor="<?php echo $bg;?>"><?php echo $arr[2];?></td>
    <td width="53" height="22" align="center" bgcolor="<?php echo $bg;?>"><a href="add.php?id=<?php echo $arr[0]?>"></a></td>
    <td width="60" height="22" align="center" bgcolor="<?php echo $bg;?>"><a href="?id=<?php echo $arr[0]?>&page=<?php echo $page?>"  onClick="return confirm("?")"></a></td>
  </tr>
   <?php }}if($count==0){?>
  <tr>
    <td  height="300" colspan="6" align="center" bgcolor="-sharpFFFFFF" class="zz" >!</td>
  </tr>
    <?php }?>
  <tr align="center">
    <td height="25" colspan="7" bgcolor="-sharpf7f7f7">
    <a href="?page=1"></a>
    <?php if($page>1){?>
    <a href="?page=<?php echo ($page - 1)?>"></a><?php }?>
    - <?php echo $page?> -
    <?php if($countPage>$page){?>
    <a href="?page=<?php echo ($page+1)?>"></a><?php }?>
    <a href="?page=<?php echo $countPage?>"></a>    <?php echo $countPage?>, <?php echo $count?>
    <input type="submit" onClick="return confirm("")" name="Submit2" value=" ">
()
<input name="act" type="hidden" id="act" value="delall"></td>
  </tr>
  </form>
</table>
    </td>
    <td width="11" background="../images/44_11.jpg"></td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" height="26"><img src="../images/44_12.jpg" width="10" height="26" alt="" /></td>
    <td background="../images/44_13.jpg"></td>
    <td width="11"><img src="../images/44_15.jpg" width="11" height="26" alt="" /></td>
  </tr>
</table>
</body>
</html>

now it is not accurate to count the number of prawns. Which prawn can help
while ($ar=mysqli_fetch_row ($result)) {$count = $ar [0];}

)
Feb.27,2021

does not quite understand the meaning of the subject, but if you want to limit the number of queries, you can add a limit


to find the number of records that meet the criteria. There are several

in total.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8e5bd-45c52.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8e5bd-45c52.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?