PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Bigun
Forum Contributor
Posts: 237 Joined: Tue Jun 13, 2006 10:50 am
Post
by Bigun » Tue Jun 20, 2006 12:15 pm
I'm attempting to save a HTML textarea to a MySQL database.
It kinda works, except it doesn't seem to like newlines.
Like:
Only Saves:
What gives?
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Tue Jun 20, 2006 12:46 pm
What is the field type in your table?
Bigun
Forum Contributor
Posts: 237 Joined: Tue Jun 13, 2006 10:50 am
Post
by Bigun » Tue Jun 20, 2006 12:56 pm
varchar(255)
RobertGonzalez
Site Administrator
Posts: 14293 Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA
Post
by RobertGonzalez » Tue Jun 20, 2006 1:49 pm
I'm not sure a varchar() field can handle text type stuff. Try changing the field type to text and see if that does anything different.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jun 20, 2006 2:26 pm
varchar is a text type. It can handle it, the problem can easily be that the code you've entered is longer than 255 characters, the limit of your field.
Bigun
Forum Contributor
Posts: 237 Joined: Tue Jun 13, 2006 10:50 am
Post
by Bigun » Tue Jun 20, 2006 2:28 pm
Bingo... that did it.