[eluser]comyou[/eluser]
Hello everyone,
I currently have a page which displays all Teams and Team Members from MySQL results.
Im trying to make it so that it doesn't show a particular team if there are no members in that team.
The code I have at the moment is:
Code:
<div id="content-wrapper">
<div id="content">
<h1>Dynasty Roster</h1>
<?php foreach(fetch('team_mdl') as $team) : ?>
<div class='widget team'>
<h ><span ><?= str_replace('_', ' ', $team->platform) ?></span><?= $team->name; ?></h2>
<ul>
<?php foreach(fetch('team_member_mdl', 'team='.$team->id.'') as $member) : ?>
<li>
<?= $member->firstname ?>"
<?= $member->gamertag ?>"
<?= $member->lastname ?>-
<?= $team->name; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endforeach; ?>
</div>
</div>
I imagine I'd need to do something like
Code:
<div id="content-wrapper">
<div id="content">
<h1>Dynasty Roster</h1>
<?php foreach(fetch('team_mdl') as $team) : ?>
<div class='widget team'>
<h ><span ><?= str_replace('_', ' ', $team->platform) ?></span><?= $team->name; ?></h2>
<ul>
<?php foreach(fetch('team_member_mdl', 'team='.$team->id.'') as $member) : ?>
<?php if(///////FETCH_RESULTS /////////!= 0): ?>
<li>
<?= $member->firstname ?>"
<?= $member->gamertag ?>"
<?= $member->lastname ?>-
<?= $team->name; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<?php endforeach; ?>
</div>
</div>
but Im not sure how to go about doing it? :S