
May 12th, 2003, 04:23 PM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
passing information
Hi,
I have a drop down menu that pulls information based on option selected:
<%
varClass = Request.QueryString("classname")
%>
...
<OPTION VALUE="index3.asp?classname=Leadership Excellence Phase I">Leadership Excellence Phase I</option>
I'm using classname instead of classid because I have several classes with the same name but different ids (diff dates).
Once a user selects an option from there they should be able to enroll and/or view a roster of those already enrolled. If I hardcode the value for one particular class everything comes up perfectly. Since I want to do this dynmaically based on on the classname how do I use the variable correctly in my select statement?
Here what I have so far and I tried the following:
mySQL="SELECT c.classID, c.className, c.classDate, c.maxEnroll, count(e.enrollID) as enrolled "&_
"FROM classTable c "&_
"LEFT JOIN enrollTable e ON c.classID = e.classID "&_
"WHERE c.className = 'Leadership Training Phase I' "&_
"GROUP BY c.classID, c.className, c.classDate, c.maxEnroll"
I've tried:
mySQL="SELECT c.classID, c.className, c.classDate, c.maxEnroll, count(e.enrollID) as enrolled "&_
"FROM classTable c "&_
"LEFT JOIN enrollTable e ON c.classID = e.classID "&_
"WHERE c.className = '" & classname & "' "&_
"GROUP BY c.classID, c.className, c.classDate, c.maxEnroll"
STILL NOT WORKING...HELP!
I've also tried:
mySQL="SELECT c.classID, c.className, c.classDate, c.maxEnroll, count(e.enrollID) as enrolled "&_
"FROM classTable c "&_
"LEFT JOIN enrollTable e ON c.classID = e.classID "&_
"WHERE c.className = "' & Request.QueryString "className") '""&_
"GROUP BY c.classID, c.className, c.classDate, c.maxEnroll"
This also doesn't work. This should be simple but I need help!
|