Jump to content


Photo

MySQL with Textbox


  • Please log in to reply
4 replies to this topic

#1 joecooper

joecooper
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 26 February 2006 - 12:10 AM

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!
Signature:
[/a]
[a href="http://www.planet-so...=1999&lngWId=8" target="_blank"]EzLogin 1.0[/a]
[a href="http://www.essexracers.com" target="_blank"]Essexracers.com[/a]
Msn Messenger: joe@joeyjoe.co.uk

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 26 February 2006 - 12:22 AM

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:
echo nl2br($your_database_field);
Is that what you meant?
Legend has it that reading the manual never killed anyone.
My site

#3 joecooper

joecooper
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 26 February 2006 - 01:20 AM

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
Signature:
[/a]
[a href="http://www.planet-so...=1999&lngWId=8" target="_blank"]EzLogin 1.0[/a]
[a href="http://www.essexracers.com" target="_blank"]Essexracers.com[/a]
Msn Messenger: joe@joeyjoe.co.uk

#4 crystalthunder

crystalthunder
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 26 February 2006 - 01:31 AM

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.

#5 joecooper

joecooper
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 26 February 2006 - 01:37 PM

Thats what i needed! Thanks!
Signature:
[/a]
[a href="http://www.planet-so...=1999&lngWId=8" target="_blank"]EzLogin 1.0[/a]
[a href="http://www.essexracers.com" target="_blank"]Essexracers.com[/a]
Msn Messenger: joe@joeyjoe.co.uk




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users