473,941 Members | 2,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Line breaks in MySQL Text Field don't show when displayed in web page

2 New Member
I am using a form to enter data and I want to be able to add line breaks within a single field

<shift><enter > or <control><enter > puts them into the form field and they seem to be stored in the MySQL database I write to. (They are visisble when the field is browsed using phpMyAdmin)

Howvever, when I write the field back to the screen

echo $row['NewsDETAIL'] ;

the line breaks are lost, for example:

"line 1

line 2

line 3"

becomes

"line 1 line 2 line 3"

Can anynone help?
Aug 7 '07 #1
0 1716

Sign in to post your reply or Sign up for a free account.

Similar topics

6
63220
by: Jonathan | last post by:
I want to save textarea contents to a mysql database with the paragraph breaks intact without having to type paragraph or break tags in HTML. How can I do that. So far, although it occurs naturally when I save the contents to a file, it doesn't break up the paragraphs properly when I save it to my database. Thanks! Jonathan http://thewebdevelopment.com
5
2192
by: mailbox | last post by:
Did write it down once, but have forgotten !! How is it you should format your ASP code to that when viewing the resulting HTML text from the browsers "view code" it looks nice with line breaks?
4
22790
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary to export the report? I tried exporting a report by using the .rtf rich-text format (the plain-text format was the only other word-processing option listed when exporting). I then opened the .rtf file in Word. However, it looks like some...
6
1165
by: Markus Ernst | last post by:
Hi Searching for a possibility to display some text with preserved white space and line breaks, but with long lines being wrapped, I found this CSS declaration, which I found helpful: pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */
6
5377
by: David | last post by:
We have VS2005 ASP.NET 2.0 application that needs to have each paragraph separated by a line break. I have added "<br />" into the text column (SQL 2000) and it works fine when displaying on a web page (GridView). However, when I export the to Excel it creates separate rows for each line break, but I don't want that. Does anyone have a solution? Thanks. David
20
16661
by: alice | last post by:
I'm doing some text swapping with javascript, got it working fine, but I would like the line to have line breaks and being a beginner, I don't even know if this is possible. So I have a line like this swaptext('Shaun, Greg, Violet, Joel, 1999')"; and I would like 1999 to be on a new line. Is there a simple way to do this? I'd swear I've seen a way, but now I can't seem to find it.
2
3465
by: alexpetrie | last post by:
I am using a form to enter data and I want to be able to add line breaks within a single field <shift><enter> or <control><enter> puts them into the form field and they seem to be stored in the MySQL database I write to. (They are visisble when the field is browsed using phpMyAdmin) Howvever, when I write the field back to the screen echo $row ; the line breaks are lost, for example:
5
3781
by: The Pipe | last post by:
Hello I have a table that I need to export to a .asc file format. I have had several attempts at getting this to work but with no luck. Basically the file would need to have every record displayed on a separate line - If you like a CrLF delimited file. The unfortunate thing is that the file is to be then imported into a third party piece of software and as such I have no other alternative but to use this file format. Does anyone have...
3
1867
by: paul814 | last post by:
I have a MYSQL DB that people enter data into through a multiline textbox, and then i display the data on a search results page. Here is how I display it: while($row=mysql_fetch_object($rs)){ print "<div class=\"message\">"; print " <h3>" . $row->itdate . "</h3>"; print " <h5>" . $row->itname . "</h5>"; print " <h4>" . $row->itcomments ."</h4>";
0
9964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11296
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10659
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9858
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6080
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.