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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher 2008-06-27 20:38:59 +00:00
parent d4ddf14b6b
commit ed553a7c77
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";
}