Re: Splitting Article Pages
| From: | Hugh Bothwell | Date: | Wed, 11 Jul 2001 13:12:52 +0000 |
| Subject: | Re: Splitting Article Pages | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-10279@lists.php.net to get a copy of this message | ||
"Jordan Elver" <jord.elver@virgin.net> wrote in message
news:01071112364501.01160@localhost.localdomain...
> Hi,
> I need to split an article over several pages. I know how to create next
and
> previous links for database queries. But how can I pull out say, an
article
> from a database and split the article text over a certain amount of pages
> depending on the article length, so every 500 words and new page is
created?
How are your articles formatted? If your paragraphs are of fairly
consistent length, it might be easier to split the document and store it by
paragraph. Add a 'para' field to your table, and you can pull out any set
of paragraphs you like, ie
SELECT text FROM articles
WHERE id=$article AND para >= $start AND para < {$start+$length}
ORDER BY para ASC
This would allow you to let users choose the page length they prefer.