]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/earning_functions.php
Removed 2nd parameter for assert() as this is only available in PHP 5.4.8+ but Mailer...
[mailer.git] / inc / libs / earning_functions.php
index 345a06cd5386667752b94b456345b31fac7f7f09..fb2e847bdde2249893f324acc431e10405ce70bd 100644 (file)
@@ -103,7 +103,7 @@ function doMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
 // Insert member earning entry
 function insertMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
        // Insert the record
-       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_earning` (`earning_id`, `earning_userid`, `earning_daily_amount`, `earning_active`) VALUES(%s,%s,%s,'%s')",
+       sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_earning` (`earning_id`, `earning_userid`, `earning_daily_amount`, `earning_active`) VALUES(%s,%s,%s,'%s')",
                array(
                        bigintval($earningId),
                        getMemberId(),
@@ -113,7 +113,7 @@ function insertMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
 
        // Prepare content
        $content = array(
-               'insert_id'    => SQL_INSERT_ID(),
+               'insert_id'    => getSqlInsertId(),
                'earning_id'   => bigintval($earningId),
                'daily_amount' => bigintval($dailyAmount),
                'is_active'    => $isActive
@@ -129,7 +129,7 @@ function insertMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
        sendAdminNotification('{--ADMIN_EARNING_INSERTED_SUBJECT--}', 'admin_earning_added', $content, getMemberId());
 
        // Return status
-       return ($content['insert_id'] > 0);
+       return isValidId($content['insert_id']);
 }
 
 // Update a given earning amount
@@ -144,7 +144,7 @@ function updateMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
        } // END - if
 
        // Update database record
-       SQL_QUERY_ESC("UPDATE
+       sqlQueryEscaped("UPDATE
        `{?_MYSQL_PREFIX?}_user_earning`
 SET
        `earning_daily_amount`=%s,
@@ -161,7 +161,7 @@ LIMIT 1", array(
        ), __FUNCTION__, __LINE__);
 
        // Determine whether something has changed
-       $status = (!SQL_HASZEROAFFECTED());
+       $status = (!ifSqlHasZeroAffectedRows());
 
        // Has the record changed?
        if ($status === TRUE) {