Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 12-26-2004, 11:25 PM   #1 (permalink)
Inactive
 
downtroden's Avatar
 
Join Date: 06-19-04
Location: Illinois
Posts: 149
iTrader: 0 / 0%
Latest Blog:
None

downtroden is liked by many
Send a message via AIM to downtroden
MySQL syntax question

So I've got me a good ol' fashioned sql query conundrum. Doing a site in with coldfusion and it comes to a page and does a query with MySQL and returns some values that set up the page. It brings back multiple products, and what I want to do is allow the user to be able to drill down those products to a more refined product base. So they're air conditioners, the original query returns the entire list of available models, I want them to be able to select some different options to have... 5 or less show up instead of 41. So here's what i've got...

HTML Code:
<cfquery name = "getwindowmodels" datasource="#Request.dsn#"> SELECT model, short_desc, unit_link, unit_image_s <!---Begin the decision to 're-ask' query with a single dropdown chosen, By the way this is working, but very much proof of concept and i'm stuck on how to incorporate more than one dropdown decision into the 'modified' SQL statement.---> <cfif IsDefined('form.submit')> FROM rac_units WHERE <cfoutput>#form.btu_range#;</cfoutput> <!--- If 'decision div form' submit button isn't detected, then just ask the basic SQL question to get the entire list. ---> <cfelse> FROM rac_units; </cfif> </cfquery>
So i guess what my question is, is if you know coldfusion... does this seem efficient? Or should I be using a if statement to decide on using another query instead of trying to modify one (like i am doing now). Also... what is the correct syntax for doing a AND OR command inside a WHERE question in SQL?

i.e WHERE column = value AND OR column = value AND OR column = value

So if any one of the three values are blank it will ignore them and use what it has to 'requery' the query.
downtroden is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-27-2004, 01:16 AM   #2 (permalink)
Inactive
 
downtroden's Avatar
 
Join Date: 06-19-04
Location: Illinois
Posts: 149
iTrader: 0 / 0%
Latest Blog:
None

downtroden is liked by many
Send a message via AIM to downtroden
let me change that... i got it working when you throw it three options... but now when one of them isn't picked... it errors out. Is there a catchall for MySQL in this situation? something like a *?
downtroden is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP / Mysql question JustRetarded Coding Forum 2 06-20-2007 11:29 AM
htaccess syntax question insidedesign Web Hosting Forum 3 02-26-2007 01:04 PM
MYSql Question/Help blackholenews Coding Forum 3 10-03-2006 06:33 PM
MySQL question WHERE notequals Thanol Coding Forum 5 02-22-2006 06:23 PM
mySQL syntax problems TeKBuzz Coding Forum 5 03-07-2005 02:32 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:59 AM.
© Copyright 2008 V7 Inc