Reputation: 59660
I'm only allow to store around 250 characters in db column. When I try to add large string it automatically omit the extra character. The type I used in scaffold is string
. How can I store large strings in db. I'm using MySQL
as db.
Upvotes: 1
Views: 557
Reputation: 520
use data type "text" instead of "string"
CHAR( ) : A fixed section from 0 to 255 characters long.
VARCHAR( ): A variable section from 0 to 255 characters long.
TINYTEXT: A string with a maximum length of 255 characters.
TEXT: A string with a maximum length of 65535 characters.
BLOB: A string with a maximum length of 65535 characters.
MEDIUMTEXT: A string with a maximum length of 16777215 characters.
MEDIUMBLOB: A string with a maximum length of 16777215 characters.
LONGTEXT: A string with a maximum length of 4294967295 characters.
LONGBLOB: A string with a maximum length of 4294967295 characters.
Upvotes: 3
Reputation: 9605
Instead of using :string
as your column type, use :text
- it will give you much more space to store your string.
Upvotes: 2