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:
parent
0fe67c367d
commit
b4b78c2602
|
@ -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";
|
||||
}
|
||||
|
|
Reference in New Issue