Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 php 和 mysql 做一个项目(我是新手),现在我必须将一段文本存储到我的数据库中(在一个表中,一个列中)。
我在创建表格时尝试过"varchar(5000)",但它不允许我。所以请给我一个解决方案。
"varchar(5000)"
你的 mysql 字段类型应该
TEXT or BLOB
这里 mysql 链接提供了有关数据类型的更多信息
http://dev.mysql.com/doc/refman/5.0/en/blob.html
在 MySQL 5.0.3 及更高版本中,大于 255 的 CHAR 长度是非法的,并且失败并出现错误
利用text
text
create table t (long_field text);
text最多可存储 65,535 个字符。