0
使用Perl和DBI從SQL數據庫獲取數據。我正在使用下面的代碼從表中獲取數據。除了定義3個不同的數組之外,有沒有辦法用多個字段定義一個數組?Perl中的多字段數組
$sql = "select * from tblPeople where PersonID=?";
$sth = $dbh->prepare($sql);
$sth->execute($PID);
while ($DRow = $sth->fetchrow_hashref) {
push @KnownPIDs, $DRow->{PersonID};
push @Knownoss, $DRow->{currentpos};
push @Knownnotes, $DRow->{personnotes};
}
'的perldoc perldsc'陣列-的哈希值 – toolic
請出示表模式和所期望的結果陣列的例子。 –
tblPeople,fields Personid,currentpos,personnotes。不確定數組的結果,因爲我不知道Perl中有什麼。 –