bug 1281: Fix syntax error in SQL statement bug-1281
authorBenny Baumann <BenBE@geshi.org>
Sun, 8 Jun 2014 20:10:19 +0000 (22:10 +0200)
committerBenny Baumann <BenBE@geshi.org>
Sun, 8 Jun 2014 20:10:19 +0000 (22:10 +0200)
pages/account/55.php

index b2d4501..24cc86d 100644 (file)
     <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";