Jump to content

Recommended Posts

Hey guys,

 

Alright so im kinda stuck with this query. Basically what im wanting to do is layout information in a column layout opposed to a row layout. So currently the query may look like this:

 

sorry about the formatting

id	event_id	detail_id	event	fname	lname
2	5	1	Sporting Events	bert	reijne
1	1	1	Film Festival	bert	reijne
3	2	2	Concerts	bert	reijne
5	2	3	Concerts	kira	orr
7	4	3	Theatre	kira	orr
8	5	3	Sporting Events	kira	orr
6	3	3	Movies	kira	orr
4	1	3	Film Festival	kira	orr]

 

As you can see, the event column (nudged over so may need to use your imagination) has a lot of redundent info. What im wanting to do is have something like:

 

bert reijne     Sporting Events     Film Festival   Concerts
kira orr        Concerts            Theatre         Sporting Events     Movies  Film Festival

 

Can this be done? Currently my query looks like:

SELECT 
de.id,
de.event_id,
de.detail_id,
e.event,
d.fname,
d.lname
FROM detail_event de
INNER JOIN details d ON (d.id = de.detail_id)
INNER JOIN events e ON (e.id = de.event_id)
ORDER BY d.id

 

Link to comment
https://forums.phpfreaks.com/topic/165082-grouped-layout/
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.