Jump to content

[SOLVED] MySQL results inquery


kamasheto

Recommended Posts

Hey

I have my form all set up, a wonderful textarea styled beautifully, and everything flows into the database like a charm. I check my database and the message lies right there exactly how I want it. However my problem arises when I call for the information and print it out again.

If I pass to the database:

"Hey

How are you?"

In the database it is stored:

"Hey

How are you?"

But if I call for it and print out again, it says:

"Hey How are you?"

Now what am I missing here? Thanks for any feedback :)
Link to comment
Share on other sites

Gah I didnt use code brackets on my post and it put it incorrectly...

Anyways when ever you echo the results you could do
[code]
echo str_replace("\n", "<br>", $var);
[/code]
and it would automatically replace new line characters with a html line break tag.
Link to comment
Share on other sites

My internet connection died out on me last night after reading corbin's first post and I came to conclude his second method later on. Thank you very much my problem is now solved.

@ MCP; I think I'm going to start using your nl2br function more often from now on, thanks for the heads up.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.