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

  • SEARCH
  • Home
  • 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 7006429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:28:37+00:00 2026-05-27T21:28:37+00:00

Ok so I simply call from mysql some text, and then I run it

  • 0

Ok so I simply call from mysql some text, and then I run it through nl2br to preserve linebreaks and all its symbols and what not.

code looks like this on both pages – <? echo nl2br($row[text]); ?>

now on one page it preseves line breaks quotations hyphens, everything. and on the other preseves line breaks, but has symbols within it like instaed of hyphons or quotations.

For example – Jenny and Jonny “Big Wave†video

Any help would be great

  • 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. Editorial Team
    Editorial Team
    2026-05-27T21:28:38+00:00Added an answer on May 27, 2026 at 9:28 pm

    I think you may be hitting an issue with HTML entities:

    <? echo nl2br(htmlentities($row[text])); ?>
    

    This probably won’t resolve the issue as you probably have a character encoding issue too. Make sure your database field is storing data as UTF-8, then add the following line immediately after your mysql_select_db() line:

    mysql_set_charset('utf8');
    

    Once that’s done, outputting the text should work something like this:

    <? echo nl2br(htmlentities($row[text],ENT_COMPAT,'UTF-8')); ?>
    

    An easier fix might be to ensure the “funny” quotations in the DB are replaced with “normal” quotations – “ and ” versus ” (you’ll hit the same with single quotes/apostrophes and em dashes/en dashes/etc copied from Word).

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

Sidebar

Related Questions

I have some tables in a MySQL database to represent records from a sensor.
I am new to MySQL procedures. I am simply trying to run a cursor
I am trying to migrate a PHP app from MySQL to SQLite, and some
I trying to write a simple function to call unmanaged code from managed code.
I'm writing a simple program to call a Java function from my C program.
I have been trying to call a mapreduce job from a simple java program
Is there a basic function call in MFC that simply plays the input error
I have a UIViewController — let's call it FormController — which is simply a
i am developing a one SIP application to simply make and receive a call.
My table is being populated using ajax from a mysql database. I have a

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.