Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 98641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:14:06+00:00 2026-05-11T00:14:06+00:00

I have a mysql database which as one of the fields contains a html

  • 0

I have a mysql database which as one of the fields contains a html description. This description is not in my control, and is obtained and inserted automatically. An example of one of these descriptions is here:

http://www.nomorepasting.com/getpaste.php?pasteid=22492

The data is originally exported from an access database, and seems to remain intact. An example of the exported data is here:

http://www.yousendit.com/transfer.php?action=batch_download&batch_id=TTZtWmdsT01kMnVGa1E9PQ

I am trying to output the variable containing the html description into a popupwindow, to display it as is. The code I am trying to use to do this is here:

http://www.nomorepasting.com/getpaste.php?pasteid=22498

However it produces the following html code:

http://www.nomorepasting.com/getpaste.php?pasteid=22462

There is an unclosed style tag which prevents the rest of the page from displaying, and the popup winbdow from opening. I have narrowed this down to a php problem as far as I can tell, because the data seems fine in mysql.

edit:

I just attempted to select only article_Desc from the database with this code:

http://www.nomorepasting.com/getpaste.php?pasteid=22494

Which produced this as a result:

http://www.nomorepasting.com/getpaste.php?pasteid=22496

edit2:

There seem to be a problem with the countrycode variable containing the style tag. When I remove this, the picture is displayed and the popupwindow is created, only with html results much like the last link I pasted. The data seems correct in the database, so what could be causing this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:14:07+00:00Added an answer on May 11, 2026 at 12:14 am

    The CSV file is a bit of a mess. It appears that the fields are separated by tabs and not enclosed by anything. This may be OK for simple data but when you start putting HTML in you are going to have problems – looking at one of your other questions it looks like the CSV parser is getting confused and splitting one field of HTML into several – this seems to happen everytime it encounters a tab (and maybe also double quote?)

    Are you able to change the format of the CSV file? I would suggest that you use commas to separate the fields, and that you define an enclosure character (e.g. a double quote) for more complex strings like HTML – I think that you will need to make sure that any double quotes within the string are also escaped. Also bear in mind that you may need to remove or escape line breaks from within these strings depending on what is parsing it, but I’m not completely sure of this.

    Edit after your comment

    You don’t need to worry about a string containing the delimiter, as long as it is enclosed by charactor. If you needed a row containing three fields, and the three string values were:

    String1 String2 Stri,ng3 

    The following is not valid and would be seen by the parser as four fields

    String1,String2,Stri,ng3

    The following is valid because the delimeter is ‘enclosed’ by a double-quote

    'String1', 'String2', 'Stri,ng3'

    It gets trickier then when you want to have a double quote within the string – this would then need to be escaped. If you wanted to represent

    String1 String'2 

    the CSV field could be escaped like

    'String1', 'String\'2' 

    If I remember correctly you were importing into MySQL using LOAD DATA?, so for the above examples you might want to use options like

    FIELDS TERMINATED BY ',' ENCLOSED BY ''' ESCAPED BY '\\' 

    I’m not sure how MySQL would treat line-breaks within enclosed strings, I can’t seem to find much about this. If it reads the file line-by-line you might need have problems.

    Edit 2

    If the remaining problems are line-break related you could do a string replace of \n with \\n and \r with \\r in the code that exports each field to CSV

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 134k
  • Answers 134k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It really depends on what the estimates are going to… May 12, 2026 at 6:48 am
  • Editorial Team
    Editorial Team added an answer Here is the answer to your question: Detecting and preventing… May 12, 2026 at 6:48 am
  • Editorial Team
    Editorial Team added an answer this.addEventListener(Event.ADDED_TO_STAGE, handleAdedToStage) private function handleAddedToStage(event:Event):void { this.runAssets() } private function… May 12, 2026 at 6:47 am

Related Questions

I have a mysql database set as utf-8, and csv data set as utf-8,
There are numerous libraries providing Linq capabilities to C# code interacting with a MySql
I have a PHP web application which uses a MySQL database for object tagging,
I have a very simple bit of script that changes the status of an

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.