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 8702333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:37:38+00:00 2026-06-13T02:37:38+00:00

I am using the following to submit a post from a textarea to my

  • 0

I am using the following to submit a post from a textarea to my mysql database in order to preserve single/double/triple line spacing on the output.:

$update = nl2br(htmlentities($string, ENT_QUOTES, 'UTF-8'));

Sometimes it works but sometimes a double is replaced with a single line space and other times double line spaces are preserved. Here is my output, all of this was input using double line spaces (hitting enter twice). Any suggestions on how to improve this would be appreciated:

    something

    went

    a 
    little

    wrong
    there

Thanks Prinzhorn. Below is the CREATE TABLE statement for the table in question.

CREATE TABLE IF NOT EXISTS `ticket_updates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticket_id` varchar(100) NOT NULL,
  `update` text NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `member_id` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ;
  • 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-06-13T02:37:39+00:00Added an answer on June 13, 2026 at 2:37 am

    My issue was caused by using wordwrap() to try and format the output and NOT due to:

    nl2br(htmlentities($string, ENT_QUOTES, 'UTF-8'));
    

    I changed my wordwrap($update, 50, " \n", true) to CSS3 propertey word-break:break-all; (word-break:break-word; would not work with IE9)

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

Sidebar

Related Questions

Im using the following ajax code to submit data from a form to a
I am using the following code to submit different values var evalue= 'color:#d32;font-size:12px;'; jQuery.ajax({
i want to submit a form using Ext.Direct and iam following all the guidelines
i'm using the following code to submit a form: function submitfilter(){ alert(in here); var
I am using jquery ajax api to submit (POST/GET) a text as parameter to
I'm getting values from the html using the following method: javascript: var list =
I am trying to figure out how to retrieve data from a MySQL database
I'm using the following form code: <form enctype=multipart/form-data action=process.php method=POST> <input type=text name=draftTitle/> <textarea
I'm using the following to post a message on my Facebook page: $attachment =
I'm using the following in the web page but can't get a response from

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.