我正在尝试使用单个查询将多个值插入到同一字段中。下面的代码有错误吗?
my $dbh = DBI->connect("DBI:mysql:accounting:localhost", 'username', 'password',
{RaiseError => 1});
my @id = [1,18,976,90];
my @name = ['ss','dc','ws','rd'];
my @data = ([@id],[@name]);
my $ab = $dbh->prepare("insert into table (id,name) values (?,?)";);
for my $datam (@data) {
$ab->execute(@$datam);
}
$ab->finish();
我收到以下错误:DBI::st=HASH(0*a16f774)
对于准备语句。这可能是什么原因造成的?