Database/Drop Down list help
I have a database that has several 'Courses' with 'Descriptions'. The classes are to be grouped by 'Category', using a 'CatalogID' as distinct separators. I have the coding to query the database and pull the 'Category' and place it in a drop down menu. But, the 'Courses' and 'Descriptions' are not being pulled onto the page, so somewhere I don't have my query right. I think I've stared at it too long and just can't see where I have the coding wrong. Hopefully someone can look at it and point out my error.
The <form> tag:
<form method="POST" action="select.asp?post=yes" querystring="y">
The drop down list:
<select name="Category" LANGUAGE="javascript" onchange="this.form.submit()">
<% Set rs = Server.CreateObject("adodb.recordset")
cmd = "SELECT distinct CatalogID, Category from Catalog"
rs.open cmd, conn
while not rs.eof
%>
<option value="<% = rs("CatalogID") %>"><%=rs("Category")%></option>
<% rs.movenext
wend
rs.close
%>
</select><noscript><INPUT type="submit" value="Go" name=submit></noscript>
The listing of the 'Courses' with 'Descriptions' on the page:
<% if request.querystring("POST") = "y" Then
Set rs = Server.CreateObject("adodb.recordset")
cmd = "SELECT * FROM Catalog WHERE (Category LIKE '" & request("CatalogID") & "') order by Title"
rs.open cmd, conn
While not rs.eof %>
And the 'Course' listing:
<p><b><% = rs("Title")%></b></p>
<p><%=Rs("Description")%></p>
And, finally, the closing of the loop:
<% rs.movenext
Wend
rs.close
end if
Set rs = nothing
%>
Any help would be appreciated.
|