]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Typos fixed, function IS_SQLS_INITIALIZED() added
[mailer.git] / inc / mysql-manager.php
index 781acb611c96eb8582371e38506db7ea1d4bb088..f4f85cbc21b50ff8302ae2ea94d265d153e952fa 100644 (file)
@@ -2085,7 +2085,7 @@ ORDER BY ur.refid ASC",
 }
 
 // Recuced the amount of received emails for the receipients for given email
-function REDUCT_RECIPIENT_RECEIVED_MAILS ($column, $id, $count) {
+function REDUCED_RECIPIENT_RECEIVED_MAILS ($column, $id, $count) {
        // Search for mail in database
        $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `%s`=%s ORDER BY `userid` ASC LIMIT %s",
                array($column, bigintval($id), $count), __FUNCTION__, __LINE__);
@@ -2112,6 +2112,11 @@ function INIT_SQLS () {
        SET_SQLS(array());
 }
 
+// Checks wether the sqls array is initialized
+function IS_SQLS_INITIALIZED () {
+       return ((isset($GLOBALS['sqls'])) && (is_array($GLOBALS['sqls'])));
+}
+
 // Setter for SQLs array
 function SET_SQLS ($SQLs) {
        $GLOBALS['sqls'] = (array) $SQLs;
@@ -2138,9 +2143,9 @@ function COUNT_SQLS () {
        $count = false;
 
        // Is the array there?
-       if (isset($GLOBALS['sqls'])) {
+       if (IS_SQLS_INITIALIZED()) {
                // Then count it
-               $count = count($GLOBALS['sql']);
+               $count = count($GLOBALS['sqls']);
        } // END - if
 
        // Return it
@@ -2150,10 +2155,9 @@ function COUNT_SQLS () {
 // Checks wether the SQLs array is filled
 function IS_SQLS_VALID () {
        return (
-               (isset($GLOBALS['sqls'])) &&
-               (is_array($GLOBALS['sqls'])) &&
-               (COUNT_SQL() > 0) &&
-               (!empty($GLOBALS['sqls']))
+               (IS_SQLS_INITIALIZED()) &&
+               (COUNT_SQLS() > 0) &&
+               (!empty($GLOBALS['sqls'][0]))
        );
 }