Hy all, i try to read some data with
my $tags = shift;
my $lid = $tags->{ID};
my $output;
my ( $db, $sth, $link, $cond);
$db = $DB->table ('PoInfo');
$db->select_options('LIMIT 1');
$sth = $db->select ({LinkID => $lid });
while ($link = $sth->fetchrow_hashref) {
****
}
return $output;
}
My Problem now is to read the data from the table inside an array to use later a for next loop.
Now i could get it with
my $lala = $link->{fieldname};
but cause i have a lot of fields, i wont do:
$a[0] = $link->{fieldname_0};
$a[1] = $link->{fieldname_1};
...
$a[n] = $link->{fieldname_n};
There must be a way to get it on antoher way, isnīt it?
Better than this would be something like:
get all field_names from table where value = 1
as i could do it with php.
Some ideas?
Robert
Code:
sub { my $tags = shift;
my $lid = $tags->{ID};
my $output;
my ( $db, $sth, $link, $cond);
$db = $DB->table ('PoInfo');
$db->select_options('LIMIT 1');
$sth = $db->select ({LinkID => $lid });
while ($link = $sth->fetchrow_hashref) {
****
}
return $output;
}
My Problem now is to read the data from the table inside an array to use later a for next loop.
Now i could get it with
my $lala = $link->{fieldname};
but cause i have a lot of fields, i wont do:
$a[0] = $link->{fieldname_0};
$a[1] = $link->{fieldname_1};
...
$a[n] = $link->{fieldname_n};
There must be a way to get it on antoher way, isnīt it?
Better than this would be something like:
get all field_names from table where value = 1
as i could do it with php.
Some ideas?
Robert