解决方案 »
- mysql索引疑问
- php里的如何解码。这个解码后是什么。。紧急。。。大家帮帮忙
- diccuz子论坛一说
- 为什么javascript的报错没什么用
- php 简单快速开发框架
- AjaXplorer在httpd和php环境的安装过程
- ecshop里的商品标签有什么用
- 请教能够自定义hosts文件吗?我自己的程序使用自己的hosts文件。不要用系统的
- coreseek 3.2.14版本英文字母和数字无法切分?
- select结果集不能foreach出来
- 求PHP数组分组算法
- 为什么iestore.cn的IESTORE支付时选择Bank wire payment,在按下“I confirm payment”后会出现错误:
echo "<table border=1 width=700 cellspacing=0 style=border-collapse:collapse>";
echo "<tr style=background-image:url(img/new_hader_27.jpg) height=30 style=color:#ffffff><th>选择</th><th>hotel_id</th><th>start_date</th><th>end_date</th><th>content</th><th>source</th><th>s_type</th><th>操作</th></tr>"; //查询数据
if( empty($ziduan) || empty($txt_sousuo))
$query = "SELECT * FROM hotel_activities_2";
else
$query = "SELECT * FROM hotel_activities_2 where $ziduan like '%{$txt_sousuo}%'";
$result=mysql_query($query) or die("<script>alert('查询的数据不存在');window.location='chaxun_rizhi.php';</script>");
$rowsPerPage=5;
$maxRowCount=mysql_num_rows($result);
if($maxRowCount%$rowsPerPage==0)
{
$maxPage=(int)($maxRowCount/$rowsPerPage);
}
else {
$maxPage=(int)($maxRowCount/$rowsPerPage)+1;
}
if (isset($_GET['curPage']))
{
$page=$_GET['curPage'];
}
else
{
$page=1;
}
$start=$rowsPerPage*($page-1);$sel1 = $query . " order by h_id limit $start,$rowsPerPage";$result=mysql_query($sel1) or die("查询失败");
//循环输出表中各个字段值
echo '<form action="delect_sj.php" method=post>';
while ($row = mysql_fetch_array($result)) {
echo '<tr align="center" class="shu">';
echo '<td><input type=checkbox name="hid[]" value="'.$row['h_id'].'"></td>';
echo '<td>'.$row['hotel_id'].'</td>';
echo '<td>'.$row['start_date'].'</td>';
echo '<td>'.$row['end_date'].'</td>';
echo '<td>'.$row['content'].'</td>';
echo '<td>'.$row['source'].'</td>';
echo '<td>'.$row['s_type'].'</td>';
echo '<td>'.' <a href="upedit.php?hid='.$row['h_id'].'" >编辑</a> '.'</td>';
echo '</tr>';
}
echo '<input type=submit value="删除所选" onclick="return delconfirm()"></form>';
if( empty($ziduan) || empty($txt_sousuo))
$query = "SELECT count(*) FROM hotel_activities_2";
else
$query = "SELECT count(*) FROM hotel_activities_2 where $ziduan like '%{$txt_sousuo}%'";
$res=mysql_query("$query",$connection);
$row = mysql_fetch_array($res);
$numrows=$row[0];
$pages=intval($numrows/$rowsPerPage);
if ($numrows%$rowsPerPage)
$pages++; if($page>1)
{
$prevPage=$page-1;
echo "<a href='?curPage=$prevPage'><img src='img/prev.gif'/></a>";
}
if ($page<$maxPage)
{
$nextPage=$page+1;
echo "<a href='?curPage=$nextPage'><img src='img/next.gif'/></a>";
}
echo "</table>";
echo "<div align='left' class='shu'>共有".$pages."页 当前为第".$page."页";
$query = "SELECT * FROM hotel_activities_2";
else
$query = "SELECT * FROM hotel_activities_2 where $ziduan like '%{$txt_sousuo}%'";
这里我不知道你的$ziduan和$txt_sousuo是哪来的数据.但我大概知道中间要用and而不是or,如果用||也就是or,根本没办法运行到else那去..