Zabs
Zabs

Reputation: 14142

Losing line breaks when doing a basic MySQL insert

I have a simple MySQL query that takes an html string and inserts this into a database however I always lose the line breaks - do I need to do something for it to retain the line breaks in the insert query?

Upvotes: 2

Views: 548

Answers (1)

xpda
xpda

Reputation: 15813

Load the strings back in with a query, they see if they contain line breaks. It may also be a good idea to check for ascii 13, 10, and a combination of both. If it's going in with a linefeed character (10), it's possible that MySQL is expecting a carriage return/linefeed combination, or vice versa.

Upvotes: 1

Related Questions