【发布时间】:2015-09-23 17:02:44
【问题描述】:
我的代码与下面类似:
$sth = $dbh->prepare("CREATE TABLE IF NOT EXISTS ? (`id` bigint(100) unsigned NOT NULL AUTO_INCREMENT");
$sth->execute('test');
我最终得到了错误:
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 ''test'
从跟踪中我发现 perl DBI 在表名周围加上单引号,这是 mysql 不喜欢的。如何告诉 DBI 不要放任何引号或放 (`) 而不是单引号?
【问题讨论】: