Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-03-2010, 03:53 AM   #1
Senior Member
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
How to get the "Next" button on a webpage in PHP and MySQL

I have a table full of stuff which I want to print on screen 5 at a time, with a "next" button for the next page - how do I do this?

The list for each page is obtained with a:
SELECT NAME FROM table LIMIT $start, 5;

which is simple enough, then I think I need to do a :

SELECT count (*) FROM table ;, and check if there will BE a "next" page, and then generate the link for that at the bottom of the page - how do I do this?

Old 02-03-2010, 04:31 AM   #2
Senior Member
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Send the $start as a GET variable in the URL, so your link will be something like:

Then in the $_GET superglobal array will be an element with the key 'start'


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
yum install php-mysql fails with mysql 5.1 - "Error: mysql conflicts with MySQL" rebelde Linux - Software 2 03-13-2009 11:32 AM
which is better "mysql" or "mysqli" to use in php 5.2.6 !? robertjinx Linux - Server 1 12-07-2008 09:32 AM
MySQL/PHP/Horde "Failed to write session data" Big Money Linux - Software 0 11-23-2004 02:33 PM
Php or Mysql upgrade on Fedora Core 2 "Uptodate" Program geninblaze Fedora 1 07-12-2004 10:56 PM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 09:31 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration