You are on page 1of 1

DataHash

DataHash list
Retrieve data from previous fetch for a list of field names. Returns a hash where the field name is the key.
If no field names are given, all fields are returned.

Example:
$db->Sql("SELECT f1, f2, f3 FROM foo");
$db->FetchRow();
%hash = $db->DataHash("f1", "f2");
print $hash{f1};
or
$db->Sql("SELECT * FROM foo");
$db->FetchRow();
%hash = $db->DataHash;
foreach $key (sort(keys %hash)) {
print $key, '=', $hash{$key}, "\n";
}
See also: Data

You might also like