Let me explain again, there are two tables. 1) Has the
Department Name and Phone Number. There isn't really any id's
because of the way it was orginally set up. Now there's a table in
our directory that has user's departments. What I want to do is
create a listing for Departments, which I have done with the code
below. HOwever, what I need to do is add a detail page link where
users exist in that department. If they don't exist...I don't need
there to be a link. Make Sense?
The field in the other table is called department_name as
well. Here's the code:
<cfquery name="rsDeptList" datasource="empdirectory"
username="sa" password="madmind">
SELECT *
FROM dbo.Departments
ORDER BY Department_Name ASC
</cfquery>
<cfquery name="rsDepartmentList" datasource="empdirectory"
username="sa" password="madmind">
SELECT department_name
FROM dbo.dep_personel
ORDER BY department_name ASC
</cfquery>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<table width="780" cellspacing="0" cellpadding="0">
<tr>
<td><cfoutput query="rsDeptList">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><a
href="department_details.cfm?department_name=#department_name#">#rsDeptList.Department_Name#</a></td>
<td>#rsDeptList.Phone_Number#</td>
</tr>
</table>
</cfoutput></td>
</tr>
</table>
</body>
</html>