I have two tables like this:
Employee
EmployeeID EmployeeName
1234 Jessica
1235 Tiffany
1236 Kayla
1237 Jackson
1238 Junior
1239 Ray
1240 Raymond
And...
Form
IDForm Form_EmployeeID Content AgreementBy Verificationby Validateby receiver
1 1234 abcde 1235 1236 1237 1240
2 1238 dcbe 1235 1239 1237 1240
The problem is, I want to display a data like this:
I have tried use this code:
$id=$_GET['id'];
$sql=mysql_query("SELECT Employee.*, Form.*
FROM Form
INNER JOIN Employee ON Form.Form_EmployeeID= Employee.EmployeeID
where Form.FormID = '$id'") or die(mysql_error()); $data=mysql_fetch_array($sql);
But the data appears just like this:
Form ID : 1
Employee Name : Jessica
Content : abcde
Agreement By :
Verification By:
Validate By :
Received By :
or like this:
Form ID : 1
Employee Name : Jessica
Content : abcde
Agreement By : 1235
Verification By: 1236
Validate By : 1237
Received By : 1240
May I know where is the mistake?