出于某种原因,当我写入“文本”类型的列时,我的查询搞砸了。这是一个例子:
Describe messages;
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
title varchar(255) YES NULL
body text YES NULL
to text YES NULL
content_type varchar(255) YES NULL
is_sms tinyint(1) YES NULL
user_id int(11) YES NULL
created_at datetime YES NULL
updated_at datetime YES NULL
然后我尝试插入:
INSERT INTO messages (id,title,body,to) VALUES ('1','Test Message','This is a test message. This is a test message. This is a test message. This is a test message.', 'an email' );
由于某种原因,这会导致一般的 MySQL 语法错误。如果我删除“to”列并且它是查询中的相应值,则查询工作正常。
有任何想法吗?