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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:17:37+00:00 2026-06-16T21:17:37+00:00

Hi I am using the following code to insdert data into mysql table: $sql=INSERT

  • 0

Hi I am using the following code to insdert data into mysql table:

    $sql="INSERT INTO DB (spanish, english)
VALUES
('$_POST[spanish]','$_POST[english]')";

than here is the input form:

 <form action="insert.php" method="post">
  <p>bulgarian text:</p>
  <p>
  <textarea type="textarea" cols="45" rows="5" name="bulgarian"></textarea>
  </p>
  <p>
  english text:</p>
  <p>
    <textarea type="textarea" cols="45" rows="5" name="english"></textarea>
</p>
  <p>
    <input type="submit">
  </p>
</form>

and this is the display procedure:

 while($row = mysql_fetch_array($result))
  {

  echo "<td>" . $row['english'] . "</td>";
}

my problem now is once I put the text inside the database , and than once I display it it is displayed without any formatting. I would like to know how to make it to be displayed the way it is entered inside the text area with all the formatting and the new lines

thanks.

  • 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-16T21:17:38+00:00Added an answer on June 16, 2026 at 9:17 pm

    Any data put into a <textarea> is in plain text. When you put that data in a HTML-formatted page, the browser will “collapse” the whitespace.

    There are two options:

    1. Surround your date with <pre> and </pre>, so the formatting
      stays intact.
    2. Use a function like nl2br to create (rudimentary) HTML.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following php pdo code to insert data into mysql database, the
I've the following code: $salt=uniqid(mt_rand(), false); #Add data to tables mysql_query(INSERT INTO accounts VALUES('$user',
I am using the following code to parse the XML data to MySQL table
I'm using the following code: $query = $dbh->prepare(INSERT into crm_order_errors .SET (order_id, number_of_attempts, last_attempt)
I am using QSqlQuery to insert data into a MySQL database. Currently all I
I want to insert data into mysql database using PDO of PHP. But the
I am inserting data in mysql data base using following code <?php $con =
I am trying to insert data in table in mysql database through php code
I am using the following script to import data into my mysql database from
I'm trying to insert some Binary data into a MySQL database without using prepared

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.