This is a discussion on "[SOLVED] new page, with page numbers" within the PHP Forum section. This forum, and the thread "[SOLVED] new page, with page numbers are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] new page, with page numbers
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
[SOLVED] new page, with page numbers
i have limited the amount of database info to be displayed on my blog, and i am trying to dynamically create a second page, third page etc... as the information is inputted into the database, so if i had
page 1 limit 5 if there are 6, then create next page and it goes on http://www.mywebsite.com/mypage.php?id=2 http://www.mywebsite.com/mypage.php?id=3 etc... also a numbering system, p1,p2,p3,p4 linking to newly created 'pages' how can i do that ? thanks
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
|
|
|
|
#2
|
|||
|
|||
|
Re: new page, with page numbers
I'm working on a solution. Give me a bit of time.... [HINT:] I'm using the mysql_num_rows function....
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#3
|
||||
|
||||
|
Re: new page, with page numbers
You just need to set a starting point and limit in your query.
You can do this by doing a count of the number of results in the database. Here's a simple example I just whipped up, commented for your viewing pleasure
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#4
|
|||
|
|||
|
Re: new page, with page numbers
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#5
|
||||
|
||||
|
Re: new page, with page numbers
Sorry C010depunk
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#6
|
|||
|
|||
|
Re: new page, with page numbers
I didn't know about the LIMIT 3,7 command. (I'm assuming that selects results from #3 to #7, correct me if not...) I was going to use mysql_data_seek, but LIMIT is much more efficient, especially with larger databases.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#7
|
||||
|
||||
|
Re: new page, with page numbers
thank you for your help, but i am recieving this
Quote:
Quote:
Quote:
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
|
|
#8
|
||||
|
||||
|
Re: new page, with page numbers
Nearly but not quite.
LIMIT 3, 7 would select starting from result 3 and give you 7 results. If you wanted #3 - #7 you would use LIMIT 3, 4 You want to try get as much processing and limiting done with SQL as possible as by comparison, MYSQL is much faster than PHP.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#9
|
||||
|
||||
|
Re: new page, with page numbers
Okay, change this line
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#10
|
||||
|
||||
|
Re: new page, with page numbers
wow, thats fantasically kind of you thank you - works great
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] My page numbers are falling off of my website!! | 62vye | Web Page Design | 21 | Nov 11th, 2008 16:33 |
| Green bar of colour at bottom of page gets bigger the more page is extended | pixelgirl | Web Page Design | 1 | Apr 1st, 2008 01:27 |
| internal navigation, Linking from one page to a specific div in another page. | Oak | Web Page Design | 5 | Feb 8th, 2008 23:54 |
| Linking an outside page back to previous framed page | MJustison | Starting Out | 1 | Oct 18th, 2007 17:49 |
| A gap appears beween the Page Title and the Body Content of the page. | sovereign6 | Web Page Design | 6 | Dec 18th, 2006 20:14 |