]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-send_coupon.php
Renamed function, used more "pool functions":
[mailer.git] / inc / modules / admin / what-send_coupon.php
index 86a7ac55bb74485d35cbeb5749ffe7b9afa93fb5..90c6ce402372772461a2628eba497892b70cf430 100644 (file)
@@ -82,10 +82,16 @@ ORDER BY
                        );
 
                        // Get the insert id from the table
-                       $couponId = SQL_INSERTID();
+                       $couponId = SQL_INSERT_ID();
+
+                       // Init userid array
+                       $adminUserids = array();
 
                        // Load entry
                        while (list($userid) = SQL_FETCHROW($result)) {
+                               // Debug message
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'NUMS=' . SQL_NUMROWS($result) . ',userid=' . $userid);
+
                                // By default no code is unique
                                $isUnique = FALSE;
                                $couponCode = '';
@@ -93,9 +99,9 @@ ORDER BY
                                // Look for a unique id
                                while (!$isUnique) {
                                        /*
-                                        * Add a coupon for this user, first we need to create a
-                                        * table-unique "id". The function generatePassword() can do
-                                        * this job for us but we want to exclude some characters.
+                                        * Add a coupon for this user, first generate a
+                                        * "table-unique" id number. generatePassword() can do this
+                                        * but with some characters excluded.
                                         */
                                        $couponCode = generatePassword(30, array('-', '+', '_', '/', '.'));