X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fjackpot_functions.php;h=1ab1efed809f2c4cec66716143cd2fb31bdb42e8;hb=478db1f2ee36120be530fd2e2033c80477c76e8a;hp=72e0ee7a1f99a3437f92545c75fa606eb16a3fb9;hpb=c8d76610eb94093d4eed4fcd8a6cb72e74c8f6d8;p=mailer.git diff --git a/inc/libs/jackpot_functions.php b/inc/libs/jackpot_functions.php index 72e0ee7a1f..1ab1efed80 100644 --- a/inc/libs/jackpot_functions.php +++ b/inc/libs/jackpot_functions.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -49,7 +49,7 @@ function getJackpotPoints () { // Read them $result = SQL_QUERY("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__); - // Do we have an entry? + // Is there 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__); @@ -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