|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have data in mysql that has new lines, ie.
line 1 line 2 line 3 all in one record. Is there a way I can use php to get and display each line separately? Now I just get this: line1line2line 3 but I want this: line1 line2 line3 |
|
#2
|
||||
|
||||
|
Pull your query result into an array and arrange it from there:
PHP Code:
Check out: http://www.devshed.com/Server_Side/...01_4/page1.html |
|
#3
|
|||
|
|||
|
Sorry, I don't understand still. I have a table with: name varchar(50), comment blob, ID, primary key (ID). If a typical comment was like this:
Dear so and so, I appreciate your help. Please write back. I used this as I thought you suggested: $query = "SELECT * FROM $tableName"; $result = mysql_db_query($database, $query); while ($myrow = mysql_fetch_array($result)) { $name = $myrow['name']; $line1 = $myrow['comment']; $line2 = $myrow['comment']; $line3 = $myrow['comment']; $ID = $myrow['ID']; echo "$line1<br>$line2<br>$line3"; } but all I get is the whole comment three times: Dear so and so, I appreciate your help. Please write back. Dear so and so, I appreciate your help. Please write back. Dear so and so, I appreciate your help. Please write back. I checked mysql SELECT * from Table; and the format is still intact. I want to get the same carriage return after each sentence as I stored into the mysql record. |
|
#4
|
||||
|
||||
|
|
|
#5
|
|||
|
|||
|
Thanks Onslaught, that did the trick.
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > display format with php from mysql? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|