相关疑难解决方法(0)

Perl dbi准备是错误的报价

我的代码类似于以下内容:

$sth = $dbh->prepare("CREATE TABLE IF NOT EXISTS ? (`id` bigint(100) unsigned NOT NULL AUTO_INCREMENT");
$sth->execute('test');
Run Code Online (Sandbox Code Playgroud)

我最终得到了错误:

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'
Run Code Online (Sandbox Code Playgroud)

从跟踪中我发现perl DBI在表名周围放了单引号,mysql不喜欢.如何告诉DBI不要放任何引号或放(`)而不是单引号?

mysql perl dbi

1
推荐指数
1
解决办法
127
查看次数

标签 统计

dbi ×1

mysql ×1

perl ×1