1

Topic: Problem With Broadcast Email

Whenever I try to send out an e-mail to my users, I get this error:


An error was encountered
Error: Could not get user count from database.


any ideas?

2

Re: Problem With Broadcast Email

Yup. It couldn't get the user count from the db. big_smile


Enable debug mode and post the output. smile

3

Re: Problem With Broadcast Email

how do i enable debug mode?

Re: Problem With Broadcast Email

http://punbb.org/forums/viewtopic.php?id=2658

5

Re: Problem With Broadcast Email

An error was encountered
File: /home/yougotli/public_html/yougotlinks/Forums/plugins/AP_Broadcast_Email.php
Line: 59

PunBB reported: Could not get user count from database

Database reported: ERROR: column "punbb_users.username" must appear in the GROUP BY clause or be used in an aggregate function

6

Re: Problem With Broadcast Email

PgSQL database?

http://punbb.org/forums/viewtopic.php?id=6245&p=2

7

Re: Problem With Broadcast Email

i tried changing line 55 to $sql = "SELECT count (username) AS usercount FROM ".$db->prefix."users WHERE username != 'Guest'"; like you said, and now it says

Parse error: syntax error, unexpected '"' in /home/yougotli/public_html/yougotlinks/Forums/plugins/AP_Broadcast_Email.php on line 56

8

Re: Problem With Broadcast Email

Post lines 50 through to 60, within code blocks.

9

Re: Problem With Broadcast Email

    // Display the admin navigation menu
    generate_admin_menu($plugin);
    
    $preview_message_body = nl2br(pun_htmlspecialchars($_POST['message_body']));
    
    $sql = "SELECT count (username) AS usercount FROM ".$db->prefix."users WHERE username != 'Guest'";
                FROM ".$db->prefix."users
                WHERE username != 'Guest'
                ORDER BY username";    
    $result = $db->query($sql) or error('Could not get user count from database', __FILE__, __LINE__, $db->error());
       $row = $db->fetch_assoc($result);

10

Re: Problem With Broadcast Email

    // Display the admin navigation menu
    generate_admin_menu($plugin);
    
    $preview_message_body = nl2br(pun_htmlspecialchars($_POST['message_body']));
    
    $sql = "SELECT count (username) AS usercount FROM ".$db->prefix."users WHERE username != 'Guest'";
    $result = $db->query($sql) or error('Could not get user count from database', __FILE__, __LINE__, $db->error());
       $row = $db->fetch_assoc($result);

11

Re: Problem With Broadcast Email

Thank you SOOOOOOO much MattF...I think that worked, it took me to the confirmation but I haven't sent it out yet.

12

Re: Problem With Broadcast Email

Ok I'm trying to send the e-mail out...Seems to be taking forever...It says patience is key, so I suppose it takes this long... Probably because I have over 7,000+ users.

13

Re: Problem With Broadcast Email

it went to a blank page...is that what it's suppose to do!?

14

Re: Problem With Broadcast Email

Nope. It has probably timed out. Check the server logs just to make sure. Check the threads for that plugin, if it is due to a timeout, and not a code error. There's a workaround for it.