Qualified columns in some statements
authorBernhard Froehlich <ted@convey.de>
Sat, 6 Aug 2011 18:56:38 +0000 (20:56 +0200)
committerBernhard Froehlich <ted@convey.de>
Sat, 6 Aug 2011 18:56:38 +0000 (20:56 +0200)
includes/wot.inc.php

index 68e15d5..ce35ed6 100644 (file)
@@ -14,7 +14,7 @@
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/ 
+*/
 
        function query_init ($query)
        {
 
        function get_given_assurances ($userid)
        {
-               $res = query_init ("select * from `notary` where `from`='".intval($userid)."' and `from` != `to` order by `id` asc");
+               $res = query_init ("select * from `notary` where `notary`.`from`='".intval($userid)."' and `notary`.`from` != `to` order by `notary`.`id` asc");
                return $res;
        }
 
        function get_received_assurances ($userid)
        {
-               $res = query_init ("select * from `notary` where `to`='".intval($userid)."' and `from` != `to` order by `id` asc ");
+               $res = query_init ("select * from `notary` where `notary`.`to`='".intval($userid)."' and `notary`.`from` != `notary`.`to` order by `notary`.`id` asc ");
                return $res;
        }
 
        function get_given_assurances_summary ($userid)
        {
-               $res = query_init ("select count(*) as number,points,awarded,method from notary where `from`='".intval($userid)."' group by points,awarded,method");
+               $res = query_init ("select count(*) as number,points,awarded,method from notary where `notary`.`from`='".intval($userid)."' group by points,awarded,method");
                return $res;
        }
-       
+
        function get_received_assurances_summary ($userid)
        {
-               $res = query_init ("select count(*) as number,points,awarded,method from notary where `to`='".intval($userid)."' group by points,awarded,method");
+               $res = query_init ("select count(*) as number,points,awarded,method from notary where `notary`.`to`='".intval($userid)."' group by points,awarded,method");
                return $res;
        }
 
                        $awarded = 100;
                }
                else
-                       $experience = 0;        
+                       $experience = 0;
 
                switch ($row['method'])
                {
                $res = get_given_assurances(intval($userid));
                while($row = mysql_fetch_assoc($res))
                {
-                       $fromuser = get_user (intval($row['to'])); 
+                       $fromuser = get_user (intval($row['to']));
                        calc_experience ($row,$points,$experience,$sum_experience);
                        $name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['to']));
                        output_assurances_row (intval($row['id']),$row['date'],$name,intval($row['awarded']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience);