A lot has been rewritten, ext-teams added, ext-forced continued:
[mailer.git] / inc / libs / jackpot_functions.php
index 6bf2816c4c92dc2cdd68d70c93d5caddf2cf6b05..fbe450bc27108df7b557efb2cd8ae17b206bf742 100644 (file)
@@ -52,7 +52,7 @@ function getJackpotPoints () {
        // Do we have an entry?
        if (SQL_HASZERONUMS($result)) {
                // No, so create line
-               SQL_QUERY("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
+               SQL_QUERY("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`,`points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
        } else {
                // Read the line
                $data = SQL_FETCHARRAY($result);
@@ -78,7 +78,7 @@ function addPointsToJackpot ($points) {
 // Subtracts points from the jackpot
 function subtractPointsFromJackpot ($points) {
        // First failed
-       $ret = -1;
+       $ret = false;
 
        // Get jackpot points for dummy
        $jackpot = getJackpotPoints();
@@ -88,7 +88,7 @@ function subtractPointsFromJackpot ($points) {
                // Update points when there are enougth points in jackpot
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_jackpot` SET `points`=`points`-%s WHERE `ok`='ok' LIMIT 1",
                        array($points), __FUNCTION__, __LINE__);
-               $ret = $jackpot - $points;
+               $ret = (!SQL_HASZEROAFFECTED());
        } // END - if
 
        // Free memory