define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "317");
+define('CURR_SVN_REVISION', "318");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
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";
// Free memory
SQL_FREERESULT($result_depths);
-$result = SQL_QUERY_ESC("SELECT used_points FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
- array($GLOBALS['userid']), __FILE__, __LINE__);
-list($USED) = SQL_FETCHROW($result);
-SQL_FREERESULT($result);
+// Get used points
+$USED = GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");
// Translate point into comma
$TPTS = TRANSLATE_COMMA($TPTS - $USED);
// Subtract points from database and mediadata cache
function SUB_POINTS ($uid, $points) {
// Add points to used points
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET used_points=used_points+%s WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `used_points`=`used_points`+%s WHERE userid=%s LIMIT 1",
array($points, bigintval($uid)), __FILE__, __LINE__);
// Update mediadata as well