Page 1 of 1

Can anyone tell me the SQL Statement to do the folllowing

Posted: Thu Jul 01, 2010 10:06 am
by flubberman
Hi,

Does anyone know or know where I can find the SQL Statement that gets the number of Outbox Messages for a user?

Many thanks in advance

Re: Can anyone tell me the SQL Statement to do the folllowin

Posted: Thu Jul 01, 2010 2:16 pm
by Comkid

Code: Select all

$sql = 'SELECT COUNT (*) as outbox_messages
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . '
AND pm_new = 1
AND pm_unread = 1'; 
Try that ;)

Re: Can anyone tell me the SQL Statement to do the folllowin

Posted: Thu Jul 01, 2010 2:34 pm
by flubberman
Comkid wrote:

Code: Select all

$sql = 'SELECT COUNT (*) as outbox_messages
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . '
AND pm_new = 1
AND pm_unread = 1'; 
Try that ;)
Thanks very much, If have time can you think what might be causing this issue

http://www.phpbb.com/community/viewtopi ... &t=2091570

My Counts are well off. I've Checked, Analyze, Repairs and Optimised all the PM tables but I'm seeing massive differences in PM counts etc