arleslie Posted December 3, 2008 Share Posted December 3, 2008 I'm trying to make it display like this: Group Name member, member, member Another Group another member, another member, another member Heres the table layout Groups id name captain luteinet major private Members id gamertag rank weapon bungie I only want it to display the group name one and all of the members that link with that group. I'm linking the two by "groups.name" and "members.rank" Quote Link to comment https://forums.phpfreaks.com/topic/135275-php-list/ Share on other sites More sharing options...
fenway Posted December 4, 2008 Share Posted December 4, 2008 The display has nothing to do with the query -- does the latter work? Quote Link to comment https://forums.phpfreaks.com/topic/135275-php-list/#findComment-706160 Share on other sites More sharing options...
arleslie Posted December 5, 2008 Author Share Posted December 5, 2008 I don't under stand what you mean by latter but what I need is just like a php layout that will make it the way I want. So far I haven't had anyluck with the ways I've been trying. Quote Link to comment https://forums.phpfreaks.com/topic/135275-php-list/#findComment-706358 Share on other sites More sharing options...
xtopolis Posted December 5, 2008 Share Posted December 5, 2008 fenway meant that how you display data doesn't have anything to do with how you query the database. How does the Members table relate to the Group table? Does each member have a Group ID = to one of the Groups.id ? All we can see is that you have 2 tables, but no indicator that they are related.. if the Members table had a column like say: "gid" meaning group id, and each member had the value of an id in the Groups table, that would show their relation. Quote Link to comment https://forums.phpfreaks.com/topic/135275-php-list/#findComment-706464 Share on other sites More sharing options...
arleslie Posted December 5, 2008 Author Share Posted December 5, 2008 I only want it to display the group name one and all of the members that link with that group. I'm linking the two by "groups.name" and "members.rank" As I stated above the to tables are linked by groups.name and members.rank. members.rank has the same value as groups.name as of which group it's in. Quote Link to comment https://forums.phpfreaks.com/topic/135275-php-list/#findComment-706468 Share on other sites More sharing options...
fenway Posted December 5, 2008 Share Posted December 5, 2008 So you're not joining the tables on a UID? That's not going to be fun for performance. Either way, it's a straight-forward join, and after that, the display is up to you. Quote Link to comment https://forums.phpfreaks.com/topic/135275-php-list/#findComment-706481 Share on other sites More sharing options...
arleslie Posted December 5, 2008 Author Share Posted December 5, 2008 can a mod rename this to PHP List [MySQL] and move it to the PHP area? Quote Link to comment https://forums.phpfreaks.com/topic/135275-php-list/#findComment-707168 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.