SunQuest
           ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 22nd, 2005, 06:59 PM
perlnewbie23 perlnewbie23 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 105 perlnewbie23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 41 sec
Reputation Power: 4
HELP: How to check if Shoe Size exist in db.

Hi, I have a drop down list box that lists all the shoe sizes (5, 5.5, 6, 6.5, 7, etc). I want to know how can I check if the size exist in the database? I know it involves CFIF statements but I don't know how the structure looks like. My db is access. An example would be nice.

Thanks!

Reply With Quote
  #2  
Old March 22nd, 2005, 07:23 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Why not just populate the drop down box with a query? Then your query would only be returning sizes that are in the database. Something like:

select distinct size
from sizes
order by size
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old March 22nd, 2005, 08:59 PM
perlnewbie23 perlnewbie23 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 105 perlnewbie23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 41 sec
Reputation Power: 4
Quote:
Originally Posted by kiteless
Why not just populate the drop down box with a query? Then your query would only be returning sizes that are in the database. Something like:

select distinct size
from sizes
order by size


Ok lets say I have 2 records with the same values except they have different size (for example: record 1: Air Jordan 1, $150, 9(size); record 2: Air Jordan 1, $150, 10(size)). I know by using the sql statement you mention above will return 9 and 10. But I want both sizes (9,10) be populated in one drop down list box rather than a separate drop down list. How would I do that?

Reply With Quote
  #4  
Old March 23rd, 2005, 08:54 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
I'm not sure why you would want to do that. But if you have some other value that "connects" these, like an order id, you should be able to do:

select orderID, size
from orders
group by orderID

And then when you output the select box use <cfoutput group="orderID"> to group the sizes that are from the same orderID together.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > HELP: How to check if Shoe Size exist in db.


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway