query($sql); $count = $result->rowCount(); //计算条数 // 复制数据内容 $sql = "SELECT ID, Schedule, ApprovalID, ManufacturerCode, ApprovalDate, ProductLine, ProductType, AirPurifyingType, AtmosphereSupplyingType, ForProtectionAgainst, RatedServiceTimeMIN, FacepieceType, Powered, NumberofFilters, ReplaceableFilter, FilterLocation, CartridgeorCanister, NumberofCartCan, LocationofCartCan, ReplaceableCartCan, SCBAType, SARType, SCBAUse, AirFlow, BreathingGas, OxygeninBreathingGas, RegulatorLocation, LowTemperatureC, LowTemperatureF, ExhalationValve, SelfRescuer, Obsolete, PrivateLabels, Model, RatedDuration, CylinderPSIG, CBRNApprovalDate, Comments FROM equipment_details WHERE 1=1 ". $sql_where ." ORDER BY ApprovalID DESC limit ". $limit .",". $size .";"; //echo $sql; $result = $dbconnect->query($sql); $data = $result->fetchAll(2); //用fetchAll 返回 参数为2 返回一个数组 fetchAll 返回所有数据 fetch 返回一条数据 $sum=ceil($count/$size); //总页数 $prev=$page-1<1?1:$page-1; //上一页 $next=$page+1>$sum?$sum:$page+1; //下一页 $urlParam = '&type=' . $type . '®ulator=' . $regulator . '&against=' . $against; $prev = $prev . $urlParam; $next = $next . $urlParam; ?>