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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:42:47+00:00 2026-05-21T10:42:47+00:00

This is a simple question I believe, but can’t figure it out yet. I

  • 0

This is a simple question I believe, but can’t figure it out yet.
I have a text area that after submit goes to a database, and then I echo this text on a page, but here is the problem, say the person writes on the textarea:

Hi Robert,
This is just a test!.
Jason.

And the message goes to the database just like that, but when I echo that, I get:

Hi Robert, This is just a test!.
Jason.

This is the form:

<textarea name="newMessage" wrap="hard" cols="30" rows="3"></textarea>

<input type="submit" name="submit" value="Ingresar"> </>

This is the code I use to display the text:

<?php   
    while($row = mysql_fetch_assoc($messages)){
        echo $row['mensaje']."<br/>";
    }
?>

This is what I use to insert the code:

if(isset($_POST['submit'])){        

            $check4LB = $_POST['newMessage'];
            while($letter = mysql_fetch_assoc($check4LB)){
                if($letter=' '){
                $letter='<br/>';
                }
            } /////I know this is not write bu is the idea i thgouht at least

            $query = mysql_query("SELECT (ifnull(max(idRegistro),0) + 1) as id FROM messages");
            $row = mysql_fetch_array($query);
            $idMax = $row['id'];     
            $insertMessage = "INSERT INTO messages(idRegistro, mensaje) VALUES ('".$idMax."','".$letter."')";

             mysql_query($insertMessage) or die(mysql_error());
             echo "<meta http-equiv=Refresh content=\"0 ; url=".$_SERVER['PHP_SELF']."\">"; 
   }
  • 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-21T10:42:48+00:00Added an answer on May 21, 2026 at 10:42 am

    try echo nl2br($row['mensaje']);

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

Sidebar

Related Questions

i believe this is a simple question but i can't figure out myself. In
I believe this is a fairly simple question but I have no idea where
I have a question that's so simple I cannot believe I can't answer it
I can't believe that I can't find the answer to this question but I
this is a simple question. I have a form that is being validated using
I believe this may be a simple question, but I've looked everywhere and tried
This seems like it should have a simple solution but I can't seem to
This is a very simple setup, I can't believe but I didn't find anybody
I can't believe I am typing a question for a simple thing like this
This is a simple question yet I was unable to find any information at

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.