|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
try
Try: WHERE c.className = '" & varClass & "' "&_ or
WHERE c.className = "' & Request.QueryString("className") '""&_ |
|
#3
|
|||
|
|||
|
thanks!
The following actually worked:
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" |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > passing information |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|