From 9dd72130f253426df35db305d6b6234ce5831fa8 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 5 Sep 2007 23:02:18 +0000 Subject: Fixing update_balance git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1510 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'LedgerSMB/Form.pm') diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 8af13b55..6f504894 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -1672,11 +1672,13 @@ sub update_balance { # if we have a value, go do it if ($value) { + $table = $dbh->quote_identifier($table); + $field = $dbh->quote_identifier($field); # retrieve balance from table my $query = "SELECT $field FROM $table WHERE $where FOR UPDATE"; my ($balance) = $dbh->selectrow_array($query); - $balance += $value; + $balance = $dbh->quote($balance + $value); # update balance $query = "UPDATE $table SET $field = $balance WHERE $where"; -- cgit v1.2.3