]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/jackpot_functions.php
Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / libs / jackpot_functions.php
index 4c8efb66881b263a0a46b0521b5bcae224a03e0b..a8964e07baee0f17c26d79b61e00d358c882b73f 100644 (file)
@@ -47,19 +47,19 @@ function getJackpotPoints () {
        $data['points'] = '0.00000';
 
        // Read them
-       $result = SQL_QUERY("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__);
+       $result = sqlQuery("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__);
 
        // Is there an entry?
-       if (SQL_HASZERONUMS($result)) {
+       if (ifSqlHasZeroNums($result)) {
                // No, so create line
-               SQL_QUERY("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
+               sqlQuery("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
        } else {
                // Read the line
-               $data = SQL_FETCHARRAY($result);
+               $data = sqlFetchArray($result);
        }
 
        // Free result
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Return them
        return $data['points'];
@@ -71,7 +71,7 @@ function addPointsToJackpot ($points) {
        $jackpot = getJackpotPoints();
 
        // Update points
-       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_jackpot` SET `points`=`points`+%s WHERE `ok`='ok' LIMIT 1",
+       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_jackpot` SET `points`=`points`+%s WHERE `ok`='ok' LIMIT 1",
                array($points), __FUNCTION__, __LINE__);
 }
 
@@ -86,13 +86,13 @@ function subtractPointsFromJackpot ($points) {
        // Enougth points i jackpot?
        if ($jackpot >= $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",
+               sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_jackpot` SET `points`=`points`-%s WHERE `ok`='ok' LIMIT 1",
                        array($points), __FUNCTION__, __LINE__);
-               $ret = (!SQL_HASZEROAFFECTED());
+               $ret = (!ifSqlHasZeroAffectedRows());
        } // END - if
 
        // Free memory
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Return the result
        return $ret;