dect
/
asterisk
Archived
13
0
Fork 0

Separate multiple items encoded into a single field with ';'

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@126021 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
tilghman 2008-06-27 20:38:59 +00:00
parent 0fe67c367d
commit b4b78c2602
1 changed files with 6 additions and 2 deletions

View File

@ -57,7 +57,9 @@ if ($mode eq 'single') {
$sth->execute() || throw_error("Invalid query: $sql");
$row = $sth->fetchrow_hashref();
foreach (keys %$row) {
push @answer, encode($_) . "=" . encode($row->{$_});
foreach my $item (split /\;/, $row->{$_}) {
push @answer, encode($_) . "=" . encode($item);
}
}
$sth->finish();
$dbh->disconnect();
@ -74,7 +76,9 @@ if ($mode eq 'single') {
while (my $row = $sth->fetchrow_hashref()) {
@answer = ();
foreach (keys %$row) {
push @answer, encode($_) . "=" . encode($row->{$_});
foreach my $item (split /\;/, $row->{$_}) {
push @answer, encode($_) . "=" . encode($item);
}
}
print join("&", @answer) . "\n";
}