Jump to content

Archived

This topic is now archived and is closed to further replies.

joecooper

MySQL with Textbox

Recommended Posts

I have a textbox that all the info gets submitted to a MySQL DB. but when i load it up again, its all on 1 line. when i use <br> it does go on seperate lines, but i need it to do that without that.
any ideas?
Thanks!

Share this post


Link to post
Share on other sites
Take the textbox content 'as is' and place it in the database. When you want to display it with those newlines converted to html <br>, use the newlinestoBR function:
[code]echo nl2br($your_database_field);[/code]
Is that what you meant?

Share this post


Link to post
Share on other sites
i dont think you quite understood.

when i submit infomation from textbox and i use enter to make a newline and not <br>, when i load it with echo, it gives it on one line. i dont want that, i want it to appear exactly how i typed it

Share this post


Link to post
Share on other sites
I dont quite understand what you mean, but maybe you could wrap the text around with <pre> ... </pre>. This would display the text with the exact format that it was typed in.

Share this post


Link to post
Share on other sites

×

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.