);
// 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 = '';
// 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('-', '+', '_', '/', '.'));