2010-05-02, 01:44 PM
Yes, I already fixed this bug - I have got last problem (if I fix it I'll publish next version), maybe sombody can help me:
So as you know - Plugin has 2 tables mybb_stcp and mybb_threads:
mybb_stcp
ID | tag_name | tag_amount
1 | loled | 1
2 | haha | 3
3 | pampam | 5
4 | gogogo | 4
mybb_threads
ID | subject | fid | tag
6 | Hello all | 3 | ,hello,all,
7 | My name is | 4 | ,my,name,is,
8 | I like pie | 3 | ,I, like,pie,
9 | Come on | 3 | ,come, on,
(fid - ID forum where is tag)
I want to get tags from all threads where fid = 3 and get their amounts (from mybb_stcp.tag_amount)
So I wrote:
But it does not work, what's wrong with this code?
So as you know - Plugin has 2 tables mybb_stcp and mybb_threads:
mybb_stcp
ID | tag_name | tag_amount
1 | loled | 1
2 | haha | 3
3 | pampam | 5
4 | gogogo | 4
mybb_threads
ID | subject | fid | tag
6 | Hello all | 3 | ,hello,all,
7 | My name is | 4 | ,my,name,is,
8 | I like pie | 3 | ,I, like,pie,
9 | Come on | 3 | ,come, on,
(fid - ID forum where is tag)
I want to get tags from all threads where fid = 3 and get their amounts (from mybb_stcp.tag_amount)
So I wrote:
SELECT `mybb_threads`.tag, `mybb_threads`.fid,
`mybb_stcp`.tag_name, `mybb_stcp`.tag_amount
FROM
`mybb_stcp` LEFT JOIN `mybb_threads`
ON locate(','`mybb_stcp`.tag_name',', `mybb_threads`.tag)=1 AND`mybb_threads`.fid != ''
WHERE
`mybb_threads`.fid = 3
ORDER BY RAND()
But it does not work, what's wrong with this code?