Hello, I am a little stumped here. I have a few tables I am trying to display data with. The first is tbl_pilot which holds data such as ID numbers that come from other tables. So my issue is tbl_pilot there are 3 airframe choices tblPilotAirframeChoiceID1FK,tblPilotAirframeChoiceID2FK,tblPilotAirframeChoiceID3FK.
I am trying to display the name of these id from another table tblkp_airframe, which associates an ID with a name.
So my JOIN which displays everything in HeidiSQL
SELECT * FROM tbl_pilot
JOIN tblkp_sim_platform platform ON (platform.tblkpSimPlatformIDPK = tbl_pilot.tblPilotSimPlatformIDFK)
JOIN tblkp_airframe acft1 ON (acft1.tblkpAirframeIDPK = tbl_pilot.tblPilotAirframeChoiceID1FK)
JOIN tblkp_airframe acft2 ON (acft2.tblkpAirframeIDPK = tbl_pilot.tblPilotAirframeChoiceID2FK)
JOIN tblkp_airframe acft3 ON (acft3.tblkpAirframeIDPK = tbl_pilot.tblPilotAirframeChoiceID3FK)
I then run my php loop
<?php while ($rowPending = $stmt -> fetch()) //loops thru pending pilots WHILE1
{
//looks plaform name
?>
<tr>
<td><?php echo '<a href="mailto:' . $rowPending['tblPilotEmailtxt'] . '">' . $rowPending['tblPilotFirstNametxt'] . " " . $rowPending['tblPilotLastNametxt'] . '</a>'; ?>
<td><?php echo $rowPending['tblkpSimPlatformtxt']; ?></td>
<td><?php echo $rowPending['tblPilotHomeICAOtxt']; ?></td>
<td><?php echo $rowPending['tblkpICAOTxt']; ?></td>
<td><?php echo $rowPending['tblkpICAOTxt']; ?></td>
<td><?php echo $rowPending['tblkpICAOTxt']; ?></td>
</tr>
<?php $_SESSION['id'] = $rowPending['tblPilotVatsimIDPK']; } //this passes the users row id ?>
The issue that I have is that when I view it on the webpage instead of shoiwng the text name for each choice it only repeats choic3 all 3 times. I think it has to do with possible alias but i cant wrap my head around it. I am able to display "tblkpSimPlatformtxt" properly but there is only 1 option for that unlike the 3 for the "tblkpICAOTxt" Any help is much appreciated.