Jump to content

mysql text field


proctk

Recommended Posts

Hi

 

I have a DB with a column that is set as Text format. The data stored in the field will be stored in many lines. When I get the data from the DB I want it to display where the line breaks are I'm not sure how to write the script to do this. I have worked withe explode before but there is nothing come at the end of each line to do this with.

 

any help is excellent

Link to comment
Share on other sites

First are you looking for a constant or a counting number (like Line 1, Line 2, Line3)

secondly,

since nl2br is converting all the \n to <br />

lets explode the string at the "<br />";

then say foreach($exploded as $value)  echo $i: $value; $i++;  something like that (its psedeo code not real stuff)

 

as long as you don't have a lot of lines (like more than 100)

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.