OK, Morty -- sorry about that... I've changed my new line 170 to:
echo "<p> The SQL: ||SELECT email_addr, gets_mail, last_modified, date_subscribed, e.id AS id, act_code, subscribe_ip FROM $t_emails e, $t_cats c WHERE email_addr LIKE '$email' $wadd AND e.id = c.id AND c.cat_id IN ($sel_cats) GROUP BY e.id ORDER BY $sortsrt LIMIT $start, $limit||</p>";
Now, after bringing up first (successful) List addresses and THEN clicking "-->>" I get this (from line 170 above):
The SQL: ||SELECT email_addr, gets_mail, last_modified, date_subscribed, e.id AS id, act_code, subscribe_ip FROM wp_post_notification_emails e, wp_post_notification_cats c WHERE email_addr LIKE '%' AND gets_mail = 1 AND e.id = c.id AND c.cat_id IN (3,70,64,15,25) GROUP BY e.id ORDER BY id ASC LIMIT 50, 50||
Maybe that will help?
So my lines 160-172 currently look like:
echo "<p> The SQL: ||SELECT email_addr, gets_mail, last_modified, date_subscribed, id, act_code, subscribe_ip FROM $t_emails WHERE email_addr LIKE '$email' $wadd ORDER BY $sortsrt LIMIT $start, $limit||</p>";
$emails = $wpdb->get_results("SELECT email_addr, gets_mail, last_modified, date_subscribed, id, act_code, subscribe_ip FROM $t_emails WHERE email_addr LIKE '$email' $wadd ORDER BY $sortsrt LIMIT $start, $limit ");
$total = $wpdb->get_var("SELECT COUNT(*) FROM $t_emails WHERE email_addr LIKE '$email' $wadd");
} else {
$emails = $wpdb->get_results("SELECT email_addr, gets_mail, last_modified, date_subscribed, e.id AS id, act_code, subscribe_ip FROM $t_emails e, $t_cats c WHERE email_addr LIKE '$email' $wadd AND e.id = c.id AND c.cat_id IN ($sel_cats) GROUP BY e.id ORDER BY $sortsrt LIMIT $start, $limit ");
$total = $wpdb->get_var("SELECT COUNT(e.id) FROM $t_emails e, $t_cats c WHERE email_addr LIKE '$email' $wadd AND e.id = c.id AND c.cat_id IN ($sel_cats)");
}
if (!$emails) {
echo '<p class="error">' . __('No entries found!', 'post_notification') . '</p>';
echo "<p> The SQL: ||SELECT email_addr, gets_mail, last_modified, date_subscribed, e.id AS id, act_code, subscribe_ip FROM $t_emails e, $t_cats c WHERE email_addr LIKE '$email' $wadd AND e.id = c.id AND c.cat_id IN ($sel_cats) GROUP BY e.id ORDER BY $sortsrt LIMIT $start, $limit||</p>";
echo '</div>';
return;