Connect with mysql and retrive data from the table.
my $db ="JJusers";
my $user ="root";
my $password ="abcdef";
my $host ="localhost";
my $dbh =DBI->connect("DBI:mysql:$db:$host",$user,$password);
my $uDt = $dbh->prepare("select Username,Password from Users");
my $rv = $uDt->execute;
print "<script>alert($rv)</script>";
当我执行此代码时,我得到的结果为1
. 在数据库中,数据存储为:
1, jj, pp(SNO, USERNAME,PASSWORD)
为什么它没有得到正确的数据?