PDA

View Full Version : recordset + Split content + mysql


trainer2006
03-02-2006, 10:57 AM
Hi Guys,

I have made a recordset which fetches a large amount of text from my database. And I dont know how to split the content??? - in other words I need to split up the text - is it possible to do so from the recordset???



kind regards trainer2006

domedia
03-02-2006, 12:37 PM
I've deleted your other post. Don't crosspost.

davidj
03-02-2006, 12:43 PM
in split do you mean limit

in other words just display 50 posts per page with << >> page navigation

trainer2006
03-03-2006, 08:20 AM
I dont know what you mean???

/t

davidj
03-03-2006, 08:52 AM
ok
your recordset returns 1000 results

do you want to split these into smaller results by only displaying 50 per page at a time but allowing the user to click a next page button

trainer2006
03-07-2006, 07:53 AM
BACK...

I want to split the content for example:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean dictum sagittis nibh. Cras feugiat pede euismod nunc. Fusce in quam nec nulla placerat imperdiet. Pellentesque cursus lacus at sem. Donec sit amet nulla. Curabitur rhoncus varius magna. Donec est risus, condimentum malesuada, mattis sit amet, lacinia nec, dolor. Curabitur tempus, ipsum vestibulum pellentesque blandit, orci urna porta erat, non placerat diam odio eget ligula. Praesent ac elit eget nibh faucibus vulputate. Praesent ullamcorper faucibus velit. Integer malesuada fermentum pede. Suspendisse scelerisque porta urna. Fusce blandit suscipit orci.

and split it to:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean dictum sagittis nibh. Cras feugiat pede euismod nunc. Fusce in quam nec nulla placerat imperdiet. Pellentesque cursus lacus at sem. Donec sit amet nulla. Curabitur rhoncus varius magna.

Donec est risus, condimentum malesuada, mattis sit amet, lacinia nec, dolor. Curabitur tempus, ipsum vestibulum pellentesque blandit, orci urna porta erat, non placerat diam odio eget ligula.

Praesent ac elit eget nibh faucibus vulputate. Praesent ullamcorper faucibus velit. Integer malesuada fermentum pede. Suspendisse scelerisque porta urna. Fusce blandit suscipit orci.


kind regards trainer

davidj
03-07-2006, 03:16 PM
and split it to:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean dictum sagittis nibh. Cras feugiat pede euismod nunc. Fusce in quam nec nulla placerat imperdiet. Pellentesque cursus lacus at sem. Donec sit amet nulla. Curabitur rhoncus varius magna.

Donec est risus, condimentum malesuada, mattis sit amet, lacinia nec, dolor. Curabitur tempus, ipsum vestibulum pellentesque blandit, orci urna porta erat, non placerat diam odio eget ligula.

Praesent ac elit eget nibh faucibus vulputate. Praesent ullamcorper faucibus velit. Integer malesuada fermentum pede. Suspendisse scelerisque porta urna. Fusce blandit suscipit orci.

let me get this right

are you wanting to space out a passage of text into paragraphs

trainer2006
03-08-2006, 09:10 AM
yes thats correct... I know that you can use the in myphpadmin... but thats very time consumming... to that everytime...


/trainer...

davidj
03-08-2006, 10:20 AM
if the text is unformated when inserted into the db then this is going to be difficult

you could try using the nl2br() function as this will take \n\r at the end of every line and add a
after the new line & C return so it will break correctly

here is a nl2p function which may help which will replace \n\r with



function nl2p($text) {
return "

" . str_replace("\n", "</p>

", $text) . "</p>";
}

addition..
the problem is that how do you know when to properly

a passage of text.

you cant add after a word count as that wouldnt work properly

You cant really do the example above either as that wouldnt work properly

Mmm this is a tricky one...

unless you are keying the data into the system yourself then your going to have probs

how is the text getting into your db????

trainer2006
03-13-2006, 11:41 AM
I just copy my text into myphpadmin... what do other people do??? I just need to split up the text? thats it...



kind regards trainer

davidj
03-13-2006, 12:39 PM
best wat would be to copy the text into a html text area then do an insert into you db.
set your db field to text then your text will be output as it was input

trainer2006
03-13-2006, 08:19 PM
Ok, thx I will try that... actually I think I have tried that. But I'll do it again... :wink:


/trainer - I'll be back otherwise...