summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2014-06-08 22:10:19 +0200
committerBenny Baumann <BenBE@geshi.org>2014-06-08 22:10:19 +0200
commit8606a043a55a82bef908a80809129386a4bf83ce (patch)
tree161014b3d83e5547e091a779a1e2c0cf52230540
parent8cfdf4cd1ec9e81b1263c1d8d0b39703982f65e3 (diff)
downloadcacert-devel-refs/heads/bug-1281.tar.gz
cacert-devel-refs/heads/bug-1281.tar.xz
cacert-devel-refs/heads/bug-1281.zip
bug 1281: Fix syntax error in SQL statementbug-1281
-rw-r--r--pages/account/55.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/pages/account/55.php b/pages/account/55.php
index b2d4501..24cc86d 100644
--- a/pages/account/55.php
+++ b/pages/account/55.php
@@ -87,9 +87,18 @@
<tr><td colspan="3" class="DataTD"><a href="account.php?id=43&amp;userid=<?=intval($user_id)?>">back</a></td></tr>
<?
} else {
- $query = 'SELECT `u`.id, `u`.`assurer`, SUM(`points`) FROM `users` AS `u`, `notary` AS `n` '.
- ' WHERE `u`.`id` = \''.(int)intval($_SESSION['profile']['id']).'\' AND `n`.`to` = `u`.`id` AND `expire` < now() and and `n`.`deleted` = 0'.
- ' GROUP BY `u`.id, `u`.`assurer`';
+ $query = '
+ SELECT `u`.`id`,
+ `u`.`assurer`,
+ SUM(`points`)
+ FROM `users` AS `u`,
+ `notary` AS `n`
+ WHERE `u`.`id` = \''.intval($_SESSION['profile']['id']).'\'
+ AND `n`.`to` = `u`.`id`
+ AND `expire` < NOW()
+ AND `n`.`deleted` = 0
+ GROUP BY `u`.`id`, `u`.`assurer`
+ ';
$res = mysql_query($query);
if (!$res) {
print '<td colspan="3" class="DataTD">'._('Internal Error').'</td>'."\n";