MyBB Support

COUNT (SQL) problem

Submitted by DarSider, , Thread ID: 5026

Thread Closed

RE: COUNT (SQL) problem

DarSider
Member
Level:
0
Reputation:
13
Posts:
149
Likes:
14
Credits:
55
OP
25-06-2015, 05:15 AM
This post was last modified: 25-06-2015, 05:24 AM by DarSider
#7
Tried it in PHPMyAdmin
It returns :

My Threads TID, each TID has his own POSTNUM which is the number of posts in that thread
And not all my threads are shown, only some of them
http://prntscr.com/7l0jdh

EDIT : I added AND p.uid = 1 in the WHERE condition
I get each TID with my posts number in that thread.
I just have now to delete the group by, and i get the postnum
I just have to do this to get what i need :

SELECT COUNT(p.pid) FROM mybb_posts p LEFT JOIN mybb_threads t ON( t.tid = p.tid ) WHERE t.uid = '1' AND p.uid = '1'


LOVE YOU SOZIN <33
- Web Developer & Designer

Website : https://developement.design/
Skype : ef.team
Email : [email protected]

Users browsing this thread: 1 Guest(s)