如何在VARCHAR中插入带有空格的字符串?Mysql - 插入带空格的字符串
insert into users (user_id,firstname,lastname,email,group) values('admin','some','Body','[email protected]','Site admin');
这是给我的语法错误,我是新来的MySQL,我通过mysql的文档,这并不让我清楚地知道,为什么这种行为是去了。
mysql> insert into users (user_id,firstname,lastname,email,group) values('admin','some','Body','[email protected]','Site admin');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group) values('admin','some','Body','[email protected]','Site admin')' at line 1
请粘贴您正在获取的确切错误。 – Amber 2012-04-25 22:40:51
你给我们的'insert'语句没有什么明显的错误。要么你得到一个错误,因为你没有正确连接到数据库(或者字段类型是错误的等),或者你没有向我们展示真正的SQL语句。 – mellamokb 2012-04-25 22:46:09
用户名是一个字符串还是int?你也应该能够在varchar中有空格。 – Gohn67 2012-04-25 22:46:25