Here's a simpler question. I'm trying to show values from a table that uses several foreign keys from other tables. Unfortunately what I'm getting currently is just the foreign key values (ie. 1, 2, 3, 4). What I want to get is the values from the other tables (ie. 1 => bob, 2 => cindy) and so forth.
Here's the code I'm currently using:
In the page where the user selects the record from the main table to see the details of i use the following url (i think my url syntax is wrong):
$course_list .= "<a href=\"show_course.php?date_id=$date_id?department_id=$department_id\">$course_name</a><br />";
Then, in the processing page where the details of the course are shown, I'm trying to use the following code snippet to get the department value from the related table:
$sql = "SELECT * FROM departments WHERE department_id = '$_GET[department_id]'";
$result = @($sql,$connection) or die(mysql_error());
$department_main = $result;
further down I try to show the actual value:
<label for="department_id">Department: </label><? echo "$department_main"; ?><br />
What I'm getting is the numerical value for the department_id and not the department value from the department table. Why is this?
Thanks,
S./