Possible fix #2
authorRoland Häder <roland@mxchange.org>
Fri, 30 Oct 2009 11:56:52 +0000 (11:56 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 30 Oct 2009 11:56:52 +0000 (11:56 +0000)
inc/mysql-manager.php

index 459eeb5..4736659 100644 (file)
@@ -1919,7 +1919,7 @@ VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
 // Generate a receiver list for given category and maximum receivers
 function generateReceiverList ($cat, $receiver, $mode = '') {
        // Init variables
-       $CAT_TABS     = $cat."=%s";
+       $CAT_TABS     = '';
        $CAT_WHERE    = '';
        $receiverList = '';
        $result       = false;
@@ -1938,7 +1938,7 @@ function generateReceiverList ($cat, $receiver, $mode = '') {
        if ($cat > 0) {
                // Select category
                $CAT_TABS  = "LEFT JOIN `{?_MYSQL_PREFIX?}_user_cats` AS c ON d.userid=c.userid";
-               $CAT_WHERE = " AND c.cat_id=%s";
+               $CAT_WHERE = sprintf(" AND c.cat_id=%s", $cat);
        } // END - if
 
        // Exclude users in holiday?
@@ -1951,14 +1951,12 @@ function generateReceiverList ($cat, $receiver, $mode = '') {
                // Only include HTML receivers
                $result = SQL_QUERY_ESC("SELECT d.userid FROM `{?_MYSQL_PREFIX?}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED' AND d.`html`='Y'".$CAT_WHERE." ORDER BY d.{?order_select?} {?order_mode?} LIMIT %s",
                        array(
-                               $cat,
                                $receiver
                        ), __FUNCTION__, __LINE__);
        } else {
                // Include all
                $result = SQL_QUERY_ESC("SELECT d.userid FROM `{?_MYSQL_PREFIX?}_user_data` AS d ".$CAT_TABS." WHERE d.`status`='CONFIRMED'".$CAT_WHERE." ORDER BY d.{?order_select?} {?order_mode?} LIMIT %s",
                        array(
-                               $cat,
                                $receiver
                        ), __FUNCTION__, __LINE__);
        }