Author Topic: Datatype question for text/html  (Read 345 times)

0 Members and 1 Guest are viewing this topic.

Offline BoarderLineTopic starter

  • Enthusiast
  • Posts: 140
    • View Profile
Datatype question for text/html
« on: February 09, 2010, 12:01:03 AM »
Hi.

I am wanting to insert into a DB table a text input that contains html tags (inserted via a text editor).  The input can be up to 4000 chars long. 

My problem is I am wanting the text within the html tags to be readable in a site search, but still keep it's html appearance when called by php.  What datatype would be best to use in this case??

To keep the inputs appearance I am using wrap="virtual" in the text area input, and calling it from the database using php's nl2br.

This is working fine as a BLOB datatype, however as I found out I will not be able to search efficiently a BLOB column.  If I use TEXT as the datatype I find the output of the data when called does not fill the full width of the div I am placing it??

Any suggestions here would be greatly appreciated.

Thanks



Offline RussellReal

  • Addict
  • Posts: 1,730
  • Gender: Male
    • View Profile
Re: Datatype question for text/html
« Reply #1 on: February 09, 2010, 12:14:41 AM »
between a blob and a text datatype you should not see any change in the html equivalent to that piece of data. You might want to, however, set the max byte size of the text field to 4000.
Like my help and want to hire me? Email me or add me to MSN at RussellonMSN@hotmail.com

Offline BoarderLineTopic starter

  • Enthusiast
  • Posts: 140
    • View Profile
Re: Datatype question for text/html
« Reply #2 on: February 09, 2010, 12:29:44 AM »
Thanks RussellReal,

So TEXT datatype is best for this scenario?

Offline RussellReal

  • Addict
  • Posts: 1,730
  • Gender: Male
    • View Profile
Re: Datatype question for text/html
« Reply #3 on: February 09, 2010, 03:49:16 AM »
matter of preference there is certain quirks to blob but its not a real noticeable quirk unless your charsets conflict somehow.
Like my help and want to hire me? Email me or add me to MSN at RussellonMSN@hotmail.com