mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 18:40:46 +00:00
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:
@@ -57,7 +57,9 @@ if ($mode eq 'single') {
|
|||||||
$sth->execute() || throw_error("Invalid query: $sql");
|
$sth->execute() || throw_error("Invalid query: $sql");
|
||||||
$row = $sth->fetchrow_hashref();
|
$row = $sth->fetchrow_hashref();
|
||||||
foreach (keys %$row) {
|
foreach (keys %$row) {
|
||||||
push @answer, encode($_) . "=" . encode($row->{$_});
|
foreach my $item (split /\;/, $row->{$_}) {
|
||||||
|
push @answer, encode($_) . "=" . encode($item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$sth->finish();
|
$sth->finish();
|
||||||
$dbh->disconnect();
|
$dbh->disconnect();
|
||||||
@@ -74,7 +76,9 @@ if ($mode eq 'single') {
|
|||||||
while (my $row = $sth->fetchrow_hashref()) {
|
while (my $row = $sth->fetchrow_hashref()) {
|
||||||
@answer = ();
|
@answer = ();
|
||||||
foreach (keys %$row) {
|
foreach (keys %$row) {
|
||||||
push @answer, encode($_) . "=" . encode($row->{$_});
|
foreach my $item (split /\;/, $row->{$_}) {
|
||||||
|
push @answer, encode($_) . "=" . encode($item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print join("&", @answer) . "\n";
|
print join("&", @answer) . "\n";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user