Hello Guys,

i have this text area.

<td><font>more Information</font></td><td><textarea cols="45" rows="5" name="Details" ></textarea></td>

However someone has just filled this form, am not sure how much he wrote as when i got to my admin side that i have created it shows some of the text, id say 3,4 lines, but in mysql field it has the full text of what he has said.

How can i fix this.

THank you

Member Avatar for diafol

The user may have got an apostrophe (') or single quotes which may be 'unescaped' in the mysql field. If so, change them to \'.

Before echoing the mysql to the page, unescape the text by using the stripslashes() function.

To avoid this in the future, escape all data input with mysql_real_escape_string() or with at least addslashes(htmlentities()).

I assume that you have the field datatype as 'text'.

In addition, I'm also assuming that there are no weird symbols. The mysql_real_escape_string should make these safe anyhow.

Hello,

I had already done that, i think it was due to be me having the varchar (100).

Just changed that to longtext, i hope that does it :)

But thank you for taking your time in replying back.

Depending on the application, you might not what to save some long winded description, The MySql varchar allows for a column of up to 255 bytes. That should be more than enough for most form situations.

Member Avatar for diafol

I would wager the problem is your use of varchar. As mentioned 256 characters is the max you can hold with varchar. text datatype should meet your needs if you want more.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.