]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Required fix for NULL vs. 0 in user_points
[mailer.git] / inc / mysql-manager.php
index 8936a5a27ab69acb59aaaa1a4801cb423dba2324..4b9ee0e0138ad015586eaf8baec4091bb696f930 100644 (file)
@@ -1034,7 +1034,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
        if (!isset($GLOBALS['ref_level'])) {
                // Initialialize referal system
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' Referal system initialized!');
        if (!isset($GLOBALS['ref_level'])) {
                // Initialialize referal system
                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ' Referal system initialized!');
-               $GLOBALS['ref_level'] = '0';
+               $GLOBALS['ref_level'] = NULL;
        } else {
                // Increase referal level
                $GLOBALS['ref_level']++;
        } else {
                // Increase referal level
                $GLOBALS['ref_level']++;
@@ -1077,7 +1077,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                                        $pointsColumn,
                                        $ref_points,
                                        bigintval($userid),
                                        $pointsColumn,
                                        $ref_points,
                                        bigintval($userid),
-                                       bigintval($GLOBALS['ref_level'])
+                                       makeZeroToNull($GLOBALS['ref_level'])
                                ), __FUNCTION__, __LINE__);
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'pointsColumn='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$addMode.' - UPDATE! ('.SQL_AFFECTEDROWS().')');
 
                                ), __FUNCTION__, __LINE__);
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'pointsColumn='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$addMode.' - UPDATE! ('.SQL_AFFECTEDROWS().')');
 
@@ -1088,7 +1088,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                                        array(
                                                $pointsColumn,
                                                bigintval($userid),
                                        array(
                                                $pointsColumn,
                                                bigintval($userid),
-                                               bigintval($GLOBALS['ref_level']),
+                                               makeZeroToNull($GLOBALS['ref_level']),
                                                $ref_points
                                        ), __FUNCTION__, __LINE__);
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'data='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$addMode.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
                                                $ref_points
                                        ), __FUNCTION__, __LINE__);
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'data='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.$GLOBALS['ref_level'].',mode='.$addMode.' - INSERTED! ('.SQL_AFFECTEDROWS().')');