php中分页显示的有关问题 $_GET["page"]为空
Jun 13, 2016 am 11:05 AM
php中分页显示的问题 $_GET["page"]为空
include_once("../include/conn.php") ;
//所有订单列表
if(isset($_GET["page"])){
$page=intval($_GET["page"]) ;
}
else{
$page=1;
}
var_dump($_GET['page']) ;
$page_size=10;
$sql="select count(order_number) as num from order_table" ;
$mysql=mysql_query($sql) or die("Could not query.".mysql_error()) ;
$info=mysql_fetch_row($mysql) ;
$amount=$info["num"] ;
if($amount){
if(($amount % $page_size)==0){
$total_page=intval($amount / $page_size) ;
}
else if($amount $total_page=1 ;
}
else{
$total_page=ceil($amount / $page_size) ;
}
}
else{
$html_info="暂时没有订单。" ;
}
$string="" ;
$string .= " 首页 " ;
$string .=" " ;
if($page $string .= " 上一页 " ;
}
else{
$string .= " 上一页 " ;
}
if($page>=$total_page){
$string .= " 下一页 " ;
}
else{
$string .= " 下一页 " ;
}
$string .= " 尾页 " ;
$query_sql="select order_id , order_number from order_table order by order_id desc limit ($page-1) , 10" ;
$query=mysql_query($query_sql) ;
$str=mysql_fetch_array($query) ;
$html_info="
- " ;
- ".$order_number." " ;
do{
$order_id=$str["order_id"] ;
$order_number=$str["order_number"] ;
$html_info.="
}while($str=mysql_fetch_array($query)) ;
$html_info.="
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\WWW\demo\company\com_all.php on line 72
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\WWW\demo\company\com_all.php on line 78
红色的是错误的地方,但是var_dump()函数却输出为null,求教,这个我很急的
谢谢。
------解决方案--------------------
改過了,你試試
1 2 3 4 5 6 |
|

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP's big data structure processing skills

How to optimize MySQL query performance in PHP?

How to use MySQL backup and restore in PHP?

What are the application scenarios of Java enumeration types in databases?

How to insert data into a MySQL table using PHP?

How to fix mysql_native_password not loaded errors on MySQL 8.4

How to use MySQL stored procedures in PHP?

How to create a MySQL table using PHP?
