Hallo!
Diese komischen referenzen in Perl machen mir grad zu schaffen....
Klaro könnte ich die Daten auch direkt in der Schleife verarbeiten, aber aus bestimmten anlass will ich das erst spaeter.
Bitte sagt mir wieso das so nicht geht wie ich das versuche.
ne besser, sagt mir bitte _wie_ es geht *g*
Danke!
Aquariophile
PS.: Data::Dumper war interessant brachte mir aber nix ;p))
==============================================================
#!/usr/bin/perl
use DBI;
use strict;
print "Content-type: text/html\n\n";
my $dbh = DBI->connect('DBI:mysql:database=foobar;host=localhost', 'user', 'passwd');
my $sth = $dbh->prepare("SELECT vorname, nachname, telephon FROM tabelle WHERE vorname LIKE ?");
$sth->execute("%");
my @array;
while (my ($vorname, $nachname, $telephon) = $sth->fetchrow_array)
{
push(@array, {vorname=>$vorname, nachname=>$nachname, telephon=>$telephon});
}
print $$array[2]{vorname}; # Vom 2. Suchergebnis der Vorname
print $$array[4]{vorname}; # Vom 4. Suchergebnis das Telephon
while(@array)
{
print $$_{vorname};
print $$_{nachname};
print $$_{telephon};
}