karimali831 Posted August 1, 2010 Share Posted August 1, 2010 Hi all, Visit my website at http://cupaddon.com/?site=platforms as you can see there is "Console Platform" and two for "PC Platform". I want to group these platforms together so that all ladders are shown in each platform instead of showing each platform for each ladder if that makes sense? Here is the code: if($show_inactive_platforms) $activity = ''; else $activity = "WHERE status='1'"; $getplatforms = safe_query("SELECT * FROM ".PREFIX."cup_platforms $activity ORDER BY ID DESC"); echo '<table width="100%" bordercolor="'.$border.'">'; while($pl=mysql_fetch_array($getplatforms)) { $getladders = safe_query("SELECT * FROM ".PREFIX."cup_ladders WHERE platID='$platID'"); $total_ladder_rows = mysql_num_rows($getladders); $getmatches = safe_query("SELECT * FROM ".PREFIX."cup_standings WHERE platID='$platID'"); $played_matches = mysql_num_rows($getmatches); eval ("\$one_head = \"".gettemplate("platforms_head")."\";"); echo $one_head; eval ("\$one_head = \"".gettemplate("platforms_content")."\";"); echo $one_head; }echo '</table>'; platforms_head.html template: <tr bgcolor="$bghead"> <td colspan="5" height="20" align="center" class="title">$pl[platform]</td> </tr> platforms_content.html template: <tr> <td width="25%" align="center" bgcolor="$bg1" rowspan="6">$logo</td> <td width="55%" bgcolor="$border">$pl[name]</td> </tr> <tr> <td bgcolor="$bg1">$pl[descrip]</td> </tr> <tr> <td bgcolor="$bg2">$total_ladder_rows Total Ladders</td> </tr> <tr> <td bgcolor="$bg1">$active_teams/$all_teams Active Teams</td> </tr> <tr> <td bgcolor="$bg1">$played_matches Played Matches</td> </tr> <tr> <td bgcolor="$bg2"><img src="images/cup/icons/go.png"> <a href="?site=ladders&platID=$platID">View Ladders</a></td> </tr> <tr> <td colspan="2"></td> </tr> any help is appreciated, thank you! Quote Link to comment https://forums.phpfreaks.com/topic/209506-group-by/ Share on other sites More sharing options...
karimali831 Posted August 1, 2010 Author Share Posted August 1, 2010 anyone>? Quote Link to comment https://forums.phpfreaks.com/topic/209506-group-by/#findComment-1093893 Share on other sites More sharing options...
fenway Posted August 4, 2010 Share Posted August 4, 2010 You're talking about displaying results, not retrieving results -- that's php, not mysql. Quote Link to comment https://forums.phpfreaks.com/topic/209506-group-by/#findComment-1095216 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.