$query = "SELECT A.Agent_Name, C.Country_Name, J.Job_Type FROM Line_Items LI, Agents A,
Country C, Job J WHERE LI.Agent_ID = 1 AND LI.Agent_ID = A.Agent_ID AND
LI.Country_ID = C.Country_ID AND LI.Job_ID = J.Job_ID";
$result = mysql_query($query);
while($row = mysql_fetch_query($result)) {
echo "Agent:" . $row['Agent_Name']."<br>";
echo "Country:" . $row['Country_Name']."<br>";
echo "Job:" . $row['Job_Type']."<br>";
}
This query outputs only the first Agent in AGents table, and Country table, and Job table... I want to output the corresponding Agent Name, Country Name and Job Type from those tables, based on the entries in the Line Items table.
Please help!