喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 喜悦证交所 | 帮助

RSS 订阅当前论坛  

$5.95 Web Hosting     

上一主题 下一主题
     
标题: [问题] 请大家帮忙看看?分页程序错在那里???  
 
lionel1022
新手上路
Rank: 1



UID 99871
精华 0
积分 13
帖子 5
金钱 13 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2007-10-24
状态 离线
[广告]: 代充Paypal帐号美元
请大家帮忙看看?分页程序错在那里???

<html>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<body>
<?php
        require ('dbconnect.php'); //连接数据库
?>
<?
         //得到首页参数
        $sort =$_POST['sort'];
        $texture =$_POST['texture'];
        //查询数据库
        $dh=mysql_query(" select count(*) as plm from clothes_id as a, clothes_style as b,clothes_texture as c where a.style_id=b.style_uid and a.texture_id=c.texture_uid and b.style_uid like '$sort%' and c.texture_uid='$texture'",$conn);
        $row=mysql_fetch_array($dh);
        $row=$data['plm'];       
        if(empty($offset))
        {
                $offset=0;
        }       
        $result =mysql_query(" select * from clothes_id as a, clothes_style as b,clothes_texture as c where a.style_id=b.style_uid and a.texture_id=c.texture_uid and b.style_uid like '$sort%' and c.texture_uid='$texture' LIMIT $offset , 2",$conn);

        while($row=mysql_fetch_array($result))
        {
                echo "<img src=$row[9]>";
                echo "<br>";
                printf("服装名称:" .$row[1]);
                echo "<br>";
                printf("服装品牌:" .$row[18]);
                echo "<br>";
                printf("服装分类:" .$row[14]);
                echo "<br>";
                printf("服装风格:" .$row[24]);
                echo "<br>";
                printf("服装质地:" .$row[32]);
                echo "<br>";
                printf("服装颜色:" .$row[28]);
                echo "<br>";
                printf("服装弹力:" .$row[33]);
                echo "<br>";
                printf("服装设计师:" .$row[7]);
                echo "<br>";
                printf("服装价格:" .$row[8]);
                echo "<br>";
                printf("服装说明:" .$row[11]);
                echo "<br>";
                     echo "<br>";
                echo "<br>";
        }
        if(!$offset)
        {
                $preoffset=$offset-2;
                print "<a href=\"$PHP_SELF?offset=$preoffset\">前一页</a> \n";
                printf("preoffes:%s",$preoffget);
        }
        $pages=ceil($nr/2);
        for($i=1;$i<=$pages;$i++)
        {
                $newoffset=2*$i;
                printf("newoffset:%s",$newoffset);
                print "<a href=\"$PHP_SELF?offset=$newoffset\">$i</a> \n";
        }
        if($pages!=0 && ($newoffset/2)!=$pages)
        {
                print "<a href=\"$PHP_SELF?offset=$newoffset\">下一页</a> \n";
        }
?>
</body>
</html>Sample Text

[ 本帖最后由 lionel1022 于 2007-11-15 05:16 PM 编辑 ]
2007-11-15 05:11 PM#1
查看资料  发短消息  顶部
 
wleige (一天到晚游泳的鱼)
高级会员
Rank: 4
中级会员


UID 64348
精华 0
积分 639
帖子 676
金钱 639 喜悦币
威望 0
人脉 0
阅读权限 50
注册 2005-5-25
来自 周口人在上海
状态 离线
[广告]: 代充Paypal帐号美元
兄弟,提问题的方式要正确呀,大家是帮你解决问题的,不是帮你发现问题的。有哪些异常表现应该写清楚吧



有勇气来改变可以改变的事情,有胸怀来接受不可改变的事情,有智慧来分辨两者的不同。http://www.featuredbride.com
2007-11-16 05:29 PM#2
查看资料  访问主页  Blog  发短消息  QQ  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.023884 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP