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
https://forums.phpfreaks.com/topic/70079-mysql-text-field/
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
https://forums.phpfreaks.com/topic/70079-mysql-text-field/#findComment-351976
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.