I am attempting to join three tables, but I don't know how to distinguish between column names in one table and column names in the other. So, Here's what I'm against:
$Quest = "SELECT Techs.FirstName, Techs.LastName, Techs.FirstName, Supervisors.FirstName, Supervisors.LastName, Supervisors.SupNum, Systems.LongSystem, Techs.TechNum FROM Techs, Systems, Supervisors WHERE Supervisors.SupNum = Techs.Supervisor AND Systems.SystemNum = Techs.SystemNum ORDER BY LongSystem ASC, SupNum ASC, TechNum ASC";
$stmt = $mysqli->prepare($Quest);
$stmt->execute();
$SupResult = $stmt->get_result();
while ($row = $SupResult->fetch_assoc())
{
$SupNum = $row["SupNum"];
$SupFirst = $row["FirstName"];
$SupLast = $row["LastName"];
$LongSystem = $row["LongSystem"];
$TechNum = $row["TechNum"];
echo $LongSystem . ' !! ' . $SupNum . ' !! ' . $SupFirst . ' ' . $SupLast . ' !! ' . $TechNum . '<br>';
}
The Supervisors table has "FirstName" and "LastName" as column heads. The Techs table also has columns with those labels. How can I distinguish between the two, or would changing the field headings?
ty
tim