PDA

View Full Version : query with left join and grouping.


harmor19
15 Apr 2007, 13:06
I have two tables, "custom_droplinks_cat" and "custom_droplinks".
Below is the tables' layout. I hope it is easy to understand.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------





I don't want to ask more than I need to so I'll just ask "How do I make "Test Category" bold then place "Test Link" immediately after followed by a break (br />)?



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------





I want the result to be


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Marco van Herwaarden
15 Apr 2007, 14:24
A basic example on how you could do this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

harmor19
15 Apr 2007, 14:33
Thanks for answering my question. I'm going to try it out soon.

harmor19
17 Apr 2007, 15:38
I thought I could apply the solution Marco gave me to the real query but I can't get it to work.

Here is the actual code


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Marco van Herwaarden
17 Apr 2007, 17:52
Please post the actually code, i don't want to go decode your XML.
Also telling what is not working might also help.

harmor19
20 Apr 2007, 19:12
In the screenshot "Test1" is supposed to have "vBulletin" and "Test2" is supposed to have "Xen Web".

I'm not sure if this code snippet will suffice but I don't want to post all the code as it may be overwhelming.


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Edit: I think I may have to do two separate queries.

harmor19
20 Apr 2007, 19:43
I figured out the mistake and I fixed it.
Thanks Marco for atleast making an effort to help.

I ran into another problem but I got it situated.
I'm posting the working code here for two reasons. One is if I lose the code and the other is for other people to look at.
I wanted to use "left join" but the query got to be too complicated for me.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------