From: Roland Häder Date: Fri, 30 Oct 2009 11:56:52 +0000 (+0000) Subject: Possible fix #2 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7c183881355ea6e8dcc4324e1b081a4f75da77cb;p=mailer.git Possible fix #2 --- diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 459eeb549d..47366597c9 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -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__); }