very true, but i only told you because you asked about the "group by" statement, thanks for your help anyway, i know i can learn from your example. happy new year!
the group by was a life saver really. phpbb seems to have two copies of each message (one for the receivers inbox and one for the senders outbox) so by adding the "group by" and "count" function it removed the duplicates for me.
thanks mate!!
i got it to work from:
SELECT pt.privmsgs_text_id, u1.username as from_user, u2.username as to_user, pt.privmsgs_text
FROM phpbb_privmsgs_text pt, phpbb_privmsgs p, phpbb_users u1, phpbb_users u2
WHERE pt.privmsgs_text_id = p.privmsgs_id AND p.privmsgs_from_userid = u1.user_id...
I am looking for one query to extract private messages from a phpbb forum. For each message I want the sender and receiver of the message. I would like it to be one command if possible.
The tables are:
I will list the fields that are needed, not every field!)
table: phpbb_privmsgs_text (has...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.