HFD Posted July 21, 2008 Share Posted July 21, 2008 Hi, I'm currently designing/coding a website which uses PHP/MySQL. The site is going to be content heavy, and I plan to have the content to be retreived from a MySQL database (So the user of the site can search the site, order by certain criteria etc. Anyway... So far it's going fine, but because some of the articles are going to be rather long, I'm a bit confused about how it's best to store this in a database. I want some articles to span over multiple pages, but my original design/idea had only one field for the content (Simply 'content'). I guess the worst case scenario would be creating more fields, such as contentpage1, contentpage2 etc... I'm just wondering if there's a way in PHP to span the fields over multiple pages? Maybe even searching for a certain line in the cell (such as 'Continues on next page') and splitting it there. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/115880-splitting-a-mysql-cell-into-multiple-pages/ Share on other sites More sharing options...
Jabop Posted July 21, 2008 Share Posted July 21, 2008 http://www.google.com/search?q=pagination&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a Quote Link to comment https://forums.phpfreaks.com/topic/115880-splitting-a-mysql-cell-into-multiple-pages/#findComment-595794 Share on other sites More sharing options...
.josh Posted July 21, 2008 Share Posted July 21, 2008 As mentioned, pagination is what you're looking for. Here is a link to our own tutorial: http://www.phpfreaks.com/tutorial/basic-pagination You're gonna have to modify it a bit to suit your needs, because you're dealing with a large block of text instead of lots of rows. Best way to go about it is to make "keywords" like [pagebreak] where you want the pagebreaks to be. Or you can make pagebreaks based on how many words or lines per page. That's entirely up to you. But whatever you do, you'd add a counter into that to determine how many pages you have total and use that for the part of the script that has the page links. Quote Link to comment https://forums.phpfreaks.com/topic/115880-splitting-a-mysql-cell-into-multiple-pages/#findComment-595804 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.