Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial php+mysql写分页问题

php+mysql写分页问题

Jun 23, 2016 pm 02:05 PM

比方说在www.baidu.com?id=20 这个页面里面怎么写分页啊    因为我地址里已经有?id=20了 那 页面 2 3 4 就不能带?参数了。。。我应该怎么做


回复讨论(解决方案)

你先说一下 id=20 的含义

分页页码和id不是一个值嘛
可以这样的:www.baidu.com?id=20&page=1 //2,3,4,5等数字的。

www.baidu.com?id=20&page=1 我怎么获取page?  怎么获取id?、

楼主你问题说的不清楚  你的ID 是啥意思    你是按照ID字段进行分页么?  如果是依照ID 那么id=20  你ID不是唯一的? 一个id=20可以对应多条记录?  如果唯一 只有一条记录 何来分页?

www.baidu.com?id=20&page=1 我怎么获取page?  怎么获取id?、
先去把php的基本语法看完吧,这个都不会,我就无语了!!!!!

www.baidu.com?id=20&page=1 我怎么获取page?  怎么获取id?、 

www.baidu.com?id=20&page=1 我怎么获取page?  怎么获取id?、 

www.baidu.com?id=20&page=1 我怎么获取page?  怎么获取id?、 

呵呵,这个是很基本的PHP获取参数的知识吧

建议你去看下PHP获取参数的知识,PHP获取参数有2种方法,一种是$_GET['参数名'],另一种是表单提交的$_POST['参数名'],还有一种就是兼顾get提交和post提交的

print_r($_GET);


www.baidu.com?id=20  是$_GET[‘id’]能得到20我知道

www.baidu.com?id=20&page=1    $_GET[‘id’] 能获得20么?? $_GET[‘page’] 能获得1???

对你真的无语,你是不是没有手的?无法自己测试?一定要问才能得出结果?自己动手得到的结果不能更加证明?

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

11 Best PHP URL Shortener Scripts (Free and Premium)

Introduction to the Instagram API Introduction to the Instagram API Mar 02, 2025 am 09:32 AM

Introduction to the Instagram API

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

12 Best PHP Chat Scripts on CodeCanyon

Notifications in Laravel Notifications in Laravel Mar 04, 2025 am 09:22 AM

Notifications in Laravel

See all articles