Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Data Retrieval (un)formats my paragraphs

  • 01-07-2013 10:05am
    #1
    Registered Users, Registered Users 2 Posts: 44


    Hi,

    I have a database driven website. Im using SQL 2000 and ASP. Basically Im inserting blocks of paragraphs into the DB which is fine. When I look in the column in the DB, it holds its paragraph integrity but when I try to output it, it drops all the breaks etc and it comes out as one big blob of text.

    Is there anything I can do to retain the paragraph formatting.

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,021 ✭✭✭ChRoMe


    Hi,

    I have a database driven website. Im using SQL 2000 and ASP. Basically Im inserting blocks of paragraphs into the DB which is fine. When I look in the column in the DB, it holds its paragraph integrity but when I try to output it, it drops all the breaks etc and it comes out as one big blob of text.

    Is there anything I can do to retain the paragraph formatting.

    Thanks

    Include the html tags in the data thats inserted into the database, to retain the formatting.


  • Registered Users, Registered Users 2 Posts: 44 MikeFantana


    damn you dreamweaver....:)

    How do i automatically put those tags. Is there a script or something I can run at the insert statement.


  • Moderators, Society & Culture Moderators Posts: 17,643 Mod ✭✭✭✭Graham


    Simplest method:

    when you return the text from the database, replace the newline with a[HTML]<br>[/HTML]
    <%=replace(myData, vbNewLine, "<br />")%>
    

    If you want to get a bit fancier, put a [HTML]<p>[/HTML] tag at the start of the data returned, a [HTML]</p>[/HTML] tag at the end and replace double vbNewLine with [HTML]</p><p>[/HTML]

    These methods have the advantage of not having to edit the existing data in your database.


Advertisement