CodeIgniter Forums
How do I store a line break into a mysql database? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How do I store a line break into a mysql database? (/showthread.php?tid=23169)



How do I store a line break into a mysql database? - El Forum - 10-02-2009

[eluser]Kibret[/eluser]
I have a textarea in a form, and I tried to enter this...

eg:

Hi,
This is sample.

and then when I tried to echo the text I get

Hi, This is sample.

How can I manage to have a line break show? Thanks.


How do I store a line break into a mysql database? - El Forum - 10-02-2009

[eluser]bitist[/eluser]
You can just insert the text into textarea as it is.
But I suppose you would like to display this text as HTML somewhere, so use nl2br() function.


How do I store a line break into a mysql database? - El Forum - 10-02-2009

[eluser]Kibret[/eluser]
Thanks.

I was wondering if there is any codeigniter function related to that.


How do I store a line break into a mysql database? - El Forum - 10-02-2009

[eluser]bitist[/eluser]
Check Typography Class.
The Typography Class provides functions that help you format text.


How do I store a line break into a mysql database? - El Forum - 10-03-2009

[eluser]Kibret[/eluser]
Great. Thank you!!!