BoarderLine Posted February 9, 2010 Share Posted February 9, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/191456-datatype-question-for-texthtml/ Share on other sites More sharing options...
RussellReal Posted February 9, 2010 Share Posted February 9, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/191456-datatype-question-for-texthtml/#findComment-1009260 Share on other sites More sharing options...
BoarderLine Posted February 9, 2010 Author Share Posted February 9, 2010 Thanks RussellReal, So TEXT datatype is best for this scenario? Quote Link to comment https://forums.phpfreaks.com/topic/191456-datatype-question-for-texthtml/#findComment-1009263 Share on other sites More sharing options...
RussellReal Posted February 9, 2010 Share Posted February 9, 2010 matter of preference there is certain quirks to blob but its not a real noticeable quirk unless your charsets conflict somehow. Quote Link to comment https://forums.phpfreaks.com/topic/191456-datatype-question-for-texthtml/#findComment-1009303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.