Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Another KK question - [ Private messages ]

Aloittaja killerkraft, helmikuu 22, 2005, 03:30:12 IP

« edellinen - seuraava »

killerkraft

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

[Unknown]

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?

-[Unknown]

killerkraft

Sorry but yhe "smf_im_recipients" is not a valid table.

What table should it be ?

KK

[Unknown]

What tables do you have with "recipients" in their name?

-[Unknown]

killerkraft

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

killerkraft

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

Advertisement: