Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: killerkraft - helmikuu 22, 2005, 03:30:12 IP

Otsikko: Another KK question - [ Private messages ]
Kirjoitti: killerkraft - helmikuu 22, 2005, 03:30:12 IP
Helpers and simple users,

I want to build a simple list of all my forum users that have more than xx private messages hanging around. That is i want to be able to notify them to delete some old privates.

Could you help me to make a simple php program to do that ? A stand alone one, not agregated to the forum itself.

Thank's in advance,

KK
Otsikko: Re: Another KK question - [ Private messages ]
Kirjoitti: [Unknown] - maaliskuu 15, 2005, 08:10:15 IP
SELECT COUNT(ID_PM) AS pms, ID_MEMBER
FROM smf_im_recipients
WHERE is_deleted = 0
GROUP BY ID_MEMBER
HAVING pms > ##;

What is phpMyAdmin? (http://www.simplemachines.org/community/index.php?topic=21919.0)

-[Unknown]
Otsikko: Re: Another KK question - [ Private messages ]
Kirjoitti: killerkraft - maaliskuu 19, 2005, 06:03:14 IP
Sorry but yhe "smf_im_recipients" is not a valid table.

What table should it be ?

KK
Otsikko: Re: Another KK question - [ Private messages ]
Kirjoitti: [Unknown] - maaliskuu 19, 2005, 06:07:09 IP
What tables do you have with "recipients" in their name?

-[Unknown]
Otsikko: Re: Another KK question - [ Private messages ]
Kirjoitti: killerkraft - maaliskuu 19, 2005, 06:14:51 IP
Sorry, probably my mistake

I should read carefuly to understand your code before posting.

The database is smfim_recipients, so just the underscore to remove.

I will test and give feedback.

KK
Otsikko: Re: Another KK question - [ Private messages ]
Kirjoitti: killerkraft - maaliskuu 19, 2005, 06:19:29 IP
Ok, so the correct code should be :

SELECT COUNT(ID_PM) AS pms, ID_MEMBER
    FROM smfim_recipients
    WHERE deleted = 0
    GROUP BY ID_MEMBER
    HAVING pms > XX


but i was able to solve the problem with the folowing code as well :

SELECT ID_MEMBER, membername, instantMessages
       FROM `smfmembers`
       WHERE `instantMessages` > XX
       ORDER BY `instantMessages` ASC"


Thank's anyway for your help,

KK