FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


SQL Line breaking?





Diablosblizz
Hey, I have text inserted into my MySQL server using the varchar type. In phpmyadmin is says that there is line breaks already, but when I try to echo them out I don't see them, it's just a blob of text. Example:

Quote:
Here is some of the text here! As you can see below, there is a line break, or is there?

Line Break one, without the <BR> tag using HTML.

Another one here, wow this is pretty cool eh?


That would just turn out to be:

Quote:
Here is some of the text here! As you can see below, there is a line break, or is there? Line Break one, without the <BR> tag using HTML. Another one here, wow this is pretty cool eh?


I have tried the htmlspecialchars function, but no luck. Anybody know how to do this? Thanks!
woodenbrick
You can try using nl2br($dbString) which will convert all newlines from the string into the <br /> tag.
Diablosblizz
Ah, perfect. Works great! I feel so dumb that I forgot about that... thank you.
Related topics
Help: SQL error after uploading new files(thread updated)
SQL Basics
SQL Tutorial
Sql Error: 1017. Missing all the indexes files of phpbb
How to edit SQL files?
.sql problem
SQL error notification in my forum
Sql/Phpbb error...
SQL error
Issue uploading SQL database.
[man] SQL Error : 1054 Unknown column \'session_admin\ en DB
How do i execute an sql file in a php script?
MySql: Could not find driver
Crazy Code gone Mad!
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.