Reputation: 3
I'm creating a database with what I anticipate will be a long (perhaps several paragraphs for some tuples) attribute. I'm assigning it text instead of varchar. I have two questions:
Upvotes: 0
Views: 2020
Reputation: 157989
text field nas no length parameter.
enter whatever you with as long as it displays correctly
Upvotes: 0
Reputation: 32524
Upvotes: 3
Reputation: 17791
Upvotes: 1
Reputation: 38543
1) I do not give max length for fields that I place HTML in, as it is variable and could always grow longer. 2) I would place all HTML in the field, but it depends on if you want to do that extra step in your application.
NOTES: Always HTML encode your HTML data before inserting to database.
Upvotes: 0