I'm trying to show the first and last names from the team_members table of each team member in team_members_x table that are working on the current record being displayed to the user. Here's my incorrect code for getting the data:
$sql = "SELECT * FROM team_members LEFT JOIN team_members_x using (team_id) WHERE date_id = '".$_GET['date_id']."'";
$result = @($sql,$connection) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$team_id = ($row['team_id']);
$team_fname = ($row['team_fname']);
$team_lname = ($row['team_lname']);
}
And here's what I have for populating the page with values:
<? if(isset($team_id)) {
for($i=0; $i<=count($team_id); $i++) {
echo "$team_fname $team_lname <br />";
}}
?>
What I'm getting is just duplicate values of one name from the table and that's it. What am i doing wrong?
S./