Can anyone tell me the SQL Statement to do the folllowing

Discussion forum for MOD Writers regarding MOD Development.
Locked
flubberman
Registered User
Posts: 33
Joined: Tue May 18, 2010 11:07 am

Can anyone tell me the SQL Statement to do the folllowing

Post by flubberman » Thu Jul 01, 2010 10:06 am

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

Comkid
Registered User
Posts: 132
Joined: Thu Mar 25, 2010 5:40 am

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

Post by Comkid » Thu Jul 01, 2010 2:16 pm

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 ;)
I ist Comkid :P

flubberman
Registered User
Posts: 33
Joined: Tue May 18, 2010 11:07 am

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

Post by flubberman » Thu Jul 01, 2010 2:34 pm

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

Locked

Return to “[3.0.x] MOD Writers Discussion”