I'm working on a somewhat weird scripting dilemma I can't seem to get myself out of! Basically, I've got two recordsets which query my db and look for two things:
The first returns a list of all users.
The second checks my sessionID against a database table of of teammembers (memberID to membereeID) to see if the users listed are in the users team.
The problem is that I don't want it to filter or only show those results...as that would be far too easy
The pain in the side is that I've got it to work beautifully for the first record in the recordset. The problem is that it doesn't look past the first one.
So, finally, the question: Is there a way to loop through the recordset I'm trying to query my if then statement against? I've looked up looping, but that doesn't really seem to be the way to roll. I've also seen some loose resolutions in ASP, which doesn't help because I'm in PHP.
Any help would be simply amazing!
Here's the if/then statement code, hopefully it helps.
Code: Select all
<?php do { ?>
<tr style="cursor: pointer;" class="menudef" onmouseover="this.className='menuOver'" onmouseout="this.className='menudef'" onclick="MM_goToURL('parent','teammemberdetails.php?ID=<?php echo $row_rsTeam['ID']; ?>');return document.MM_returnValue">
<td width="31" valign="top"><img src="images/teamvitars/<?php echo $row_rsTeam['ID']; ?>.jpg" width="30" height="30" /></td>
<td width="130" valign="top"><a href="teammemberdetails.php?ID=<?php echo $row_rsTeam['ID']; ?>">
<?php echo $row_rsTeam['Username']; ?>: </a><a href="teammemberdetails.php?ID=<?php echo $row_rsTeam['ID']; ?>"><?php echo $row_rsTeam['ID']; ?><br /></a>
<?php
echo $counter ?>
<?php
// Show IF They are in your team
if (@$row_rsTeam['ID'] == @$row_rsTeamLink['AccountID']) {
?>
They're in your team.
<?php
// else Show that they are not
} else { ?>
They’re not in your team.
<?php }
?>
<?php
// Show IF This is you
if (@$row_rsTeam['ID'] == @$_SESSION['session_id']) {
?>
This is you!
<?php }
// endif this is you condition
?></td>
</tr>
<?php } while ($row_rsTeam = mysql_fetch_assoc($rsTeam)); ?>