Inserting Newline from XML to Database

Posted by blackmage on Stack Overflow See other posts from Stack Overflow or by blackmage
Published on 2010-06-17T23:32:00Z Indexed on 2010/06/18 2:03 UTC
Read the original article Hit count: 358

Filed under:
|
|
|
|

I am trying to parse this xml document in which a newline is required for certain fields and must be inserted into the database with the newline. But I've been running into problems.

1)First Problem: \n Character

The first problem I had was using the \n like below.

<javascript>jquery_ui.js\nshadowbox_modal.js\nuser_profile.js\ntablesorter.js</javascript>

The problem was in the database the field came out ot be jquery_ui.js\nshadowbox_modal.js\n... and when output into html it was jquery_ui.jsnshadowbox_modal.jsn...............

2) Then I tried actually having newlines in the xml

<javascript>jquery_ui.js
           shadowbox_modal.js
           user_profile.js
           tablesorter.js</javascript>

The problem was the output become %20%20%20%20%20%20%20%20%20%20shadowbox_modal.js, and so forth. So how can I get a newline to hold from xml when entered into a database and then output with the newline still?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql