OK I have this code set up:
<?php
$dbConnect = mysql_connect("localhost","dbuser","dbpass") or die("Problem connecting");
mysql_select_db(mydb);
$query_data = "SELECT * FROM players left join coaches on players.index = coaches.index where players.avail = 'yes'";
$data = mysql_query($query_data, $dbConnect) or die(mysql_error());
$row_data = mysql_fetch_assoc($data);
$totalRows_data = mysql_num_rows($data);
?>
<html>
<head>
<title>Available Players</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php do { ?>
<p><?php echo $row_data['teamname']; ?><br>
<?php echo $row_data['city']; ?>, <?php echo $row_data['state']; ?><br>
Contact Name: <?php echo $row_data['coach_name']; ?> Telephone: <?php echo $row_data['coach_tel']; ?><br>
Email: <?php echo $row_data['coach_email']; ?> Fax: <?php echo $row_data['coach_fax']; ?></p>
<table width="75%" border="0">
<tr bgcolor="#1C213D">
<td><font color="#FFFFFF">Player Name</font></td>
<td><font color="#FFFFFF">Hits</font></td>
<td><font color="#FFFFFF">Scores</font></td>
<td><font color="#FFFFFF">Outs</font></td>
<td><font color="#FFFFFF">Address</font></td>
<td><font color="#FFFFFF">Phone Number</font></td>
<td><font color="#FFFFFF">Available</font></td>
</tr>
<tr>
<td><?php echo $row_data['player_name']; ?></td>
<td><?php echo $row_data['hits']; ?></td>
<td><?php echo $row_data['scores']; ?></td>
<td><?php echo $row_data['out']; ?></td>
<td><?php echo $row_data['address']; ?></td>
<td><?php echo $row_data['lot']; ?></td>
<td><?php echo $row_data['phone']; ?></td>
<td><?php echo $row_data['avail']; ?></td>
</tr>
</table>
<?php } while ($row_data = mysql_fetch_assoc($data)); ?>
<p></p>
</body>
</html>
<?php
mysql_free_result($data);
?>
What it is suposed to do is display something like this:
Bears
Chicago, IL
Coach Name, Coach Telephone
Coach Email, Coach Fax
<Table of all players whos status is available in this team>
Colts
Dallas, TX
Coach Name, Coach Telephone
Coach Email, Coach Fax
<Table of all players whos status is available in this team>
The player index matches the coaches index to determine what player belongs to what team. Now the results return correct, but the dont display correctly. I want the coach info, with a table below it listing ALL the players availabke on his team.
What I get Is the coach info repeated with one player below him over and over again. It does list all available players like it should, just not all in on table. Does this make since?