ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 12th, 2003, 04:23 PM
aweise aweise is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 2 aweise User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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!

Reply With Quote
  #2  
Old May 14th, 2003, 01:28 PM
bramsey bramsey is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: USA
Posts: 226 bramsey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 40 m 35 sec
Reputation Power: 13
try

Try: WHERE c.className = '" & varClass & "' "&_ or

WHERE c.className = "' & Request.QueryString("className") '""&_

Reply With Quote
  #3  
Old May 14th, 2003, 01:36 PM
aweise aweise is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 2 aweise User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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"

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > passing information

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap