Help - Search - Members - Calendar
Full Version: desperately need help on simple coldfusion/dreamweaver proj.
BleepingComputer.com > Software > Programming
   
wagner12
Alright here we go....This project for class is due tomorrow and i'm totally stumped so any help would be greatly appreciated!!

The following information should be in the 2 column 7 row form a table i'm not sure how to insert tables in here so this will have to do...ok i have this information and the area codes obviously correspond the the states across from them and i need to take this information and......

Area Code State
319, 515, 712 Iowa
218, 320, 507 Minnesota
414, 608, 715, 920 Wisconsin
308, 402 Nebraska
314, 417, 636, 660, 81 Missouri
Other Other


Put it in the form of a 2 column 7 row table so that it accepts a list of area codes as a URL paremeter named acList and computes and displays how many in the list belong to each state.
My professor said a LIST LOOP with a SWITCH STATEMENT and the a COUNT FUNCTION is need for it to work properly.... here is an example of what one should look like.....

example... stateStats.cfm?acList=319,515,218,218,320,314,417,417,636

State Number
Iowa 2
Minnesota 3
Wisconsin 0
Nebraska 0
Missouri 4
Other 0

If anyone could help me out they would be a LIFESAVER!!!


Thank you,
wagner12
Christopher83
It's been a while since this was posted, and who knows if you're around any more, but I thought I'd reply for others, or just to throw out there that there is a CF guy lurking. Since you didn't note a version, I'll assume CFMX 7.

I'm not sure why you'll need a CFLOOP or CFSWITCH, since SQL should handle this just fine. Assuming that the AreaCode field is numeric, you'd just do something like:

CODE
select state, count(*) as ACsInList
from area_code_table
where AreaCode in (#url.acList#)
group by state


Then you just CFOUTPUT over there results to display them how you'd like.

Good Luck,
Chris.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.