|
I've been coming to this site for a while and love it! But I hope that someone can help me.
I'm in a pickle with this one.
I have 3 tables.
t_camp_locations
this holds information about each camp.
t_staff
this holds information about each staff member.
t_camp_staff
this holds id's that define what camps the staff that are entered coach at.
for example:
coach 1 is id #12 and he trains at camp id# 1,2,3,4,5,6,7,8
The admin tools for these pages are fine.
My trouble is I'm trying to create the front end that the public will see.
I can't figure out how to 'display' on the staff page a list of all the staff that trains in camp #1.
How do I pull from 2 content tables, based on what is defined in a third table?
Here is the start of what i have:
<%
Session("displayID") = request("camp_id")
'query to pull in the selected Camp Location for each staff member details
'sql = "SELECT * FROM t_camp_staff WHERE camp_id = " & request.querystring("id") & ""
sql = "SELECT * FROM t_camp_staff WHERE camp_id = '1'"
Session("staffID") = request("id")
'query to pull in the selected Camp Location for each staff member details
sql = "SELECT id FROM t_staff"
set rs = server.createobject("adodb.recordset")
rs.Open sql, conn, 3, 3
%>
<table cellpadding="4" border="0">
<%
'GET PAGE CONTENT
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open "SELECT * FROM t_staff WHERE id = " & Session("staffID") & ""
%>
<%
Do While NOT rs.EOF
Response.Write "<tr><td valign='top'>"
If rs("img") > "" Then
Response.Write "<table cellpadding='1' bgcolor='#000000'><tr><td><img src='images/staff/" & rs("img") & "'></td></tr></table>" & vbCrLf
Else
Response.Write "</td>"
End If
Response.Write "<td>"
If rs("f_name") > "" Then
Response.Write "<b>" & rs("f_name") & " " & rs("l_name") & "</b><br>" & vbCrLf
Else
Response.Write ""
End If
If rs("paragraph") > "" Then
Response.Write "" & rs("paragraph") & "<br><br>" & vbCrLf
Else
Response.Write ""
End If
Response.Write "</td></tr>"
Response.Write "<tr><td height='1'></td></tr>"
rs.MoveNext
Loop
%>
</table>
Thank you in advance for ANY help you can give me! I'm stressin'!
|
|
|
|
|
|
|
// |