I created a table as follows:
CREATE TABLE IF NOT EXISTS 'e!' (
`aa` int(11) unsigned NOT NULL auto_increment,
`showName` TEXT NOT NULL default '',
`startDateTime` DATETIME NOT NULL default '',
`endDateTime` DATETIME NOT NULL default '',
PRIMARY KEY (`aa`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
Then tried to insert with the query:
INSERT INTO e! (showname, startDateTime, endDateTime) VALUES('E! News ', '2012-05-03 19:00:00', '2012-05-03 20:00:00')
And it errors due to the !
in the table name, I'm assuming !
is a special character in mysql. I tried to escape it but the query still failed.
So, can I have special characters like !
or &
in the table name? If yes, then I probably have to encode them somehow?
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…