More places are now using GET_TOTAL_DATA() instead of query
[mailer.git] / inc / modules / member / what-order.php
index ccbc0821a5d4ec6b84077d13e020d70e0a74bb3c..9bcdff8f57d1d7c19d917b2216627e0f6a86cfa8 100644 (file)
@@ -112,12 +112,7 @@ if (SQL_NUMROWS($result_p) > 0)
        SQL_FREERESULT($result_p);
 
        // And subtract his used points...
-       $result_p = SQL_QUERY_ESC("SELECT used_points FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
-        array($GLOBALS['userid']), __FILE__, __LINE__);
-
-       list($p) = SQL_FETCHROW($result_p);
-       SQL_FREERESULT($result_p);
-       $TOTAL -= $p;
+       $TOTAL -= GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
 
        // Add (maybe) missing three zeros
        if (!ereg(".", $TOTAL)) $TOTAL .= ".00000";