projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
548a47b
)
can't use placeholders in SELECT SUM(?)
author
ivan
<ivan>
Tue, 5 Nov 2002 23:34:11 +0000
(23:34 +0000)
committer
ivan
<ivan>
Tue, 5 Nov 2002 23:34:11 +0000
(23:34 +0000)
FS/FS/cust_svc.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_svc.pm
b/FS/FS/cust_svc.pm
index
e0d582b
..
7516be5
100644
(file)
--- a/
FS/FS/cust_svc.pm
+++ b/
FS/FS/cust_svc.pm
@@
-477,14
+477,14
@@
sub attribute_since_sqlradacct {
$str2time = 'extract(epoch from ';
}
$str2time = 'extract(epoch from ';
}
- my $sth = $dbh->prepare("SELECT SUM(
?
)
+ my $sth = $dbh->prepare("SELECT SUM(
$attrib
)
FROM radacct
WHERE UserName = ?
AND $str2time AcctStopTime ) >= ?
AND $str2time AcctStopTime ) < ?
AND AcctStopTime IS NOT NULL"
) or die $dbh->errstr;
FROM radacct
WHERE UserName = ?
AND $str2time AcctStopTime ) >= ?
AND $str2time AcctStopTime ) < ?
AND AcctStopTime IS NOT NULL"
) or die $dbh->errstr;
- $sth->execute($
attrib, $
username, $start, $end) or die $sth->errstr;
+ $sth->execute($username, $start, $end) or die $sth->errstr;
$sum += $sth->fetchrow_arrayref->[0];
$sum += $sth->fetchrow_arrayref->[0];