我正在做以下事情,并且得到我认为“1”意味着声明很好。但我想取而代之的结果。如何从Perl的DBI获取MySQL查询的结果?
怎么了?
#!/usr/bin/perl
use strict;
use DBI;
my $host = "test";
my $database = "dd";
my $port = 3306;
my $user = "uuu";
my $pw = "ppp";
my $mysql = DBI->connect("DBI:mysql:database=$database;host=$host;port=$port", $user, $pw)
or die "Cannot connect to MySQL server\n";
my $m = $mysql->do(qq{select MAX(idvisit) from log_visit});
print $m;
据我通过包do'改变''给我execute'得到'无法找到对象的方法 “执行” “DBI :: DB”'。 – 2010-09-12 00:31:17
我的意思是讲课。你用过的一样。 – Femaref 2010-09-12 00:55:47