就是将一些信息从表t*读取进来,然后在另一个页面添加自己所关注的信息,也就是browse表的东西,比如关注的事youxi或者qq。然后对t*读取的数据里面有此类字的整行数据进行读取。之前我做的是读十条进来然后判断一下,有的读出来,就是下面的代码,这样就出现有些页一条都没有,有些页只有一两条。之后我用select * from t* where Op_h like %row[brow] or like row ............limit $page $pagesize。这样倒是可以,但是数据量大,添加的关注多了根本就读不出数据。希望各位大侠能给一些好的意见和建议。include("../inc/nois.php");
include("../inc/db_conn.php");
$conn = new dbClass();
$conn->Connect();$sql_page = "select count(*) from t*;
$rs_page = $conn->RetuenRow($sql_page);
$count = mysql_fetch_row($rs_page);$url=$_SERVER['REQUEST_URI'];
$url=parse_url($url);
$url=$url[path];//当页显示数目
$pagesize=10;
//得到当前最大页数
$pageindex=$count[0]/$pagesize;
if($_GET[page])
{
$pagenum=$_GET[page];
$page=($pagenum-1)*$pagesize;
$page.=',';
}?><link href="../images/style_main.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript">
<!-- Begin
//全选
function checkAll() {
var objs = window.document.getElementsByTagName("input");
for(var i=0;i<objs.length;i++){
if (objs[i].type == "checkbox" && objs[i].disabled==false){
objs[i].checked = true;
}
}
}
//全不选
function uncheckAll() {
var objs = window.document.getElementsByTagName("input");
for(var i=0;i<objs.length;i++){
if (objs[i].type == "checkbox" && objs[i].disabled==false ){
objs[i].checked = false;
}
}
}
//将用户选择的记录全部存放在数组里面。
function showValue()
{
var a=new Array();
var checkBoxes= document.getElementsByName("checkBoxName")
var idx=0;
for(var i=0;i <checkBoxes.length;i++)
{
if(checkBoxes[i].checked==true)
{
a[idx++]=checkBoxes[i].value;
}
}
setCookie("cheValue",a);
}
//将数组设置为Cookie。
</SCRIPT>
<form method="post" name="form" action="checkdel.php?cpu_action=zh_m">
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="1">
<tr align="center" bgcolor="#006699" >
<td width="3%">选择</td>
<td width="10%">号</td>
<td width="6%">名</td>
<td width="8%">**</td>
<td width="8%">**</td>
<td width="8%">系统</td>
<td width="10%">类型</td>
</tr>
<?php
$sql_count = "select count(*) from t* ";
$rs_cut = $conn->RetuenRow($sql_count);
$counts = mysql_fetch_row($rs_cut);
$i=0;
if($counts[0]!=0)
{
$sql="select * from t* order by T_time desc limit $page $pagesize";
$query=$conn->RetuenRow($sql);
while($row = mysql_fetch_array($query)){
$info = $row['Tracker_information'];
$a=explode(" ", $info);
$yanse=0;
//==================在此页对关注的信息进行标注===============================================================================================//
$aq=$row['T_e'];//作为两个表的主键
$sql_counto = "select * from op_s where Op_s = '$aq'"; //获取该cpu序列号的浏览记录
$rs_counto=$conn->RetuenRow($sql_counto);
$rowo = mysql_fetch_array($rs_counto);
$du=$rowo['Op_h'];
if($du!=NULL){
$sql_brows = "select * from browse";
$queryb=$conn->RetuenRow($sql_brows);
while($rowdd = mysql_fetch_array($queryb))
{
$con2 = explode($rowdd['b_attention'],$rowo['Op_history']);
if (count($con2)>1){
$yanse=1;
$i++;
}
}
}
//标注的代码到此为止
?>
<?php
if($yanse==1){
?>
<?php
echo "<TR align='center' bgcolor='#DFDFFF'><td><input name='checkBoxName[]' type='checkbox' style='background-color:#DFDFFF' value=".$row['T_id']." /></td>";
?> <?php
if($row['T_s']==1){
echo "<td ><font color='#FF0000'>".$row['T_e']."</font></td>";
?>
<?php } else{
echo "<td ><font color='#000000'>".$row['T_e']."</font></td>";
}?> <?php
echo "<td >".$row['T_b']."</td>";
echo "<td >".$row['T_m']."</td>";
echo "<td >".$row['T_p']."</td>";
echo "<td >".$row['T_t']."</td>";
?>
</tr>
<?php
}
}
}else
{
$str_echo="<tr ><td align='center' colspan=12>暂时信息</td></tr>";
echo $str_echo;
}
?>
<!-------->
<tr align="center" bgcolor="#006699">
<td colspan="12"><?php include("../inc/page_data.php")?></td>
</tr>
<tr bgcolor="#DFDFFF">
<td colspan="12">
<div style="height:20px;"> <strong>选择:
<a href="javascript:checkAll();">全选</a> -
<a href="javascript:uncheckAll();">取消全选</a> -
<a href="dellog.php?action=delall" onClick="return confirm('确定清空所有的记录吗?');">清空表</a> -
</td>
</tr>
</table>
</form><table >
</table>
include("../inc/db_conn.php");
$conn = new dbClass();
$conn->Connect();$sql_page = "select count(*) from t*;
$rs_page = $conn->RetuenRow($sql_page);
$count = mysql_fetch_row($rs_page);$url=$_SERVER['REQUEST_URI'];
$url=parse_url($url);
$url=$url[path];//当页显示数目
$pagesize=10;
//得到当前最大页数
$pageindex=$count[0]/$pagesize;
if($_GET[page])
{
$pagenum=$_GET[page];
$page=($pagenum-1)*$pagesize;
$page.=',';
}?><link href="../images/style_main.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript">
<!-- Begin
//全选
function checkAll() {
var objs = window.document.getElementsByTagName("input");
for(var i=0;i<objs.length;i++){
if (objs[i].type == "checkbox" && objs[i].disabled==false){
objs[i].checked = true;
}
}
}
//全不选
function uncheckAll() {
var objs = window.document.getElementsByTagName("input");
for(var i=0;i<objs.length;i++){
if (objs[i].type == "checkbox" && objs[i].disabled==false ){
objs[i].checked = false;
}
}
}
//将用户选择的记录全部存放在数组里面。
function showValue()
{
var a=new Array();
var checkBoxes= document.getElementsByName("checkBoxName")
var idx=0;
for(var i=0;i <checkBoxes.length;i++)
{
if(checkBoxes[i].checked==true)
{
a[idx++]=checkBoxes[i].value;
}
}
setCookie("cheValue",a);
}
//将数组设置为Cookie。
</SCRIPT>
<form method="post" name="form" action="checkdel.php?cpu_action=zh_m">
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="1">
<tr align="center" bgcolor="#006699" >
<td width="3%">选择</td>
<td width="10%">号</td>
<td width="6%">名</td>
<td width="8%">**</td>
<td width="8%">**</td>
<td width="8%">系统</td>
<td width="10%">类型</td>
</tr>
<?php
$sql_count = "select count(*) from t* ";
$rs_cut = $conn->RetuenRow($sql_count);
$counts = mysql_fetch_row($rs_cut);
$i=0;
if($counts[0]!=0)
{
$sql="select * from t* order by T_time desc limit $page $pagesize";
$query=$conn->RetuenRow($sql);
while($row = mysql_fetch_array($query)){
$info = $row['Tracker_information'];
$a=explode(" ", $info);
$yanse=0;
//==================在此页对关注的信息进行标注===============================================================================================//
$aq=$row['T_e'];//作为两个表的主键
$sql_counto = "select * from op_s where Op_s = '$aq'"; //获取该cpu序列号的浏览记录
$rs_counto=$conn->RetuenRow($sql_counto);
$rowo = mysql_fetch_array($rs_counto);
$du=$rowo['Op_h'];
if($du!=NULL){
$sql_brows = "select * from browse";
$queryb=$conn->RetuenRow($sql_brows);
while($rowdd = mysql_fetch_array($queryb))
{
$con2 = explode($rowdd['b_attention'],$rowo['Op_history']);
if (count($con2)>1){
$yanse=1;
$i++;
}
}
}
//标注的代码到此为止
?>
<?php
if($yanse==1){
?>
<?php
echo "<TR align='center' bgcolor='#DFDFFF'><td><input name='checkBoxName[]' type='checkbox' style='background-color:#DFDFFF' value=".$row['T_id']." /></td>";
?> <?php
if($row['T_s']==1){
echo "<td ><font color='#FF0000'>".$row['T_e']."</font></td>";
?>
<?php } else{
echo "<td ><font color='#000000'>".$row['T_e']."</font></td>";
}?> <?php
echo "<td >".$row['T_b']."</td>";
echo "<td >".$row['T_m']."</td>";
echo "<td >".$row['T_p']."</td>";
echo "<td >".$row['T_t']."</td>";
?>
</tr>
<?php
}
}
}else
{
$str_echo="<tr ><td align='center' colspan=12>暂时信息</td></tr>";
echo $str_echo;
}
?>
<!-------->
<tr align="center" bgcolor="#006699">
<td colspan="12"><?php include("../inc/page_data.php")?></td>
</tr>
<tr bgcolor="#DFDFFF">
<td colspan="12">
<div style="height:20px;"> <strong>选择:
<a href="javascript:checkAll();">全选</a> -
<a href="javascript:uncheckAll();">取消全选</a> -
<a href="dellog.php?action=delall" onClick="return confirm('确定清空所有的记录吗?');">清空表</a> -
</td>
</tr>
</table>
</form><table >
</table>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货