RE: simple cfloop

2002-03-05 Thread Bill Killillay

try this for your query
select, this, that, theotherthing
from tblName
where id IN (#form.ids#)

-Original Message-
From: Sorgatz, Rex [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 03, 2002 8:33 PM
To: CF-Talk
Subject: simple cfloop


Beginner CFer with an easy question. The situation: the user selects 
the
rows to query based upon ticking checkboxes. So, this is the first 
page:

form action=tally.cfm method=post
input type=checkbox name=id value=180
input type=checkbox name=id value=192
input type=checkbox name=id value=204
input type=checkbox name=id value=307
input type=submit value=go
/form 

Using a list and a cfloop to return multiple columns in only the rows 
the
user selects, what would the tally.cfm page look like? I'm looking at
something like this, but I know it's wrong:

cfloop index=ListIndex list=#FORM.id# delimiters=,
cfquery name=listsQuery datasource=xxx
SELECT this, that, theotherthing
FROM tblName
WHERE ID = #id#
/cfquery 
cfoutput
query=listsQuery#this#br#that#br#theotherthing#brbr/cfoutp
ut
/cfloop

Thanks for your help.


__
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



simple cfloop

2002-03-03 Thread Sorgatz, Rex

Beginner CFer with an easy question The situation: the user selects the
rows to query based upon ticking checkboxes So, this is the first page:

form action=tallycfm method=post
input type=checkbox name=id value=180
input type=checkbox name=id value=192
input type=checkbox name=id value=204
input type=checkbox name=id value=307
input type=submit value=go
/form 

Using a list and a cfloop to return multiple columns in only the rows the
user selects, what would the tallycfm page look like? I'm looking at
something like this, but I know it's wrong:

cfloop index=ListIndex list=#FORMid# delimiters=,
cfquery name=listsQuery datasource=xxx
SELECT this, that, theotherthing
FROM tblName
WHERE ID = #id#
/cfquery 
cfoutput
query=listsQuery#this#br#that#br#theotherthing#brbr/cfoutput
/cfloop

Thanks for your help

__
Why Share?
  Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://wwwpennyhostcom/redirectcfm?adcode=coldfusionc
FAQ: http://wwwthenetprofitscouk/coldfusion/faq
Archives: http://wwwmail-archivecom/cf-talk@houseoffusioncom/
Unsubscribe: http://wwwhouseoffusioncom/indexcfm?sidebar=lists



Re: simple cfloop

2002-03-03 Thread Paul Giesenhagen

The way your are doing it, just do the following:
Take plain outputs and put them around the loop (so it doesn't have to
output,output output ...(don't know if it matters)..

Then do as you were doing ...

cfoutput
cfloop index=ListIndex list=#FORM.id# delimiters=,
cfquery name=listsQuery datasource=xxx
SELECT this, that, theotherthing
FROM tblName
WHERE ID = #id#
/cfquery
#this#br#that#br#theotherthing#brbr
/cfloop
/cfoutput


You could also do IN

cfquery datasoure=xxx name=listsQuery
SELECT this, that, theotherthing
FROM tblName
WHERE ID IN (#id#)
/cfquery

cfoutput query=listsQuery
#this#br#that#br#theotherthing#brbr
/cfoutput



- Original Message -
From: Sorgatz, Rex [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Sunday, March 03, 2002 7:33 PM
Subject: simple cfloop


 Beginner CFer with an easy question. The situation: the user selects th
e
 rows to query based upon ticking checkboxes. So, this is the first page
:

 form action=tally.cfm method=post
 input type=checkbox name=id value=180
 input type=checkbox name=id value=192
 input type=checkbox name=id value=204
 input type=checkbox name=id value=307
 input type=submit value=go
 /form

 Using a list and a cfloop to return multiple columns in only the rows t
he
 user selects, what would the tally.cfm page look like? I'm looking at
 something like this, but I know it's wrong:

 cfloop index=ListIndex list=#FORM.id# delimiters=,
 cfquery name=listsQuery datasource=xxx
 SELECT this, that, theotherthing
 FROM tblName
 WHERE ID = #id#
 /cfquery
 cfoutput
 query=listsQuery#this#br#that#br#theotherthing#brbr/cfout
put
 /cfloop

 Thanks for your help.

 
__
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: simple cfloop

2002-03-03 Thread Kelly Matthews

Yep in is much better, quicker too!

[EMAIL PROTECTED] writes:
cfquery datasoure=xxx name=listsQuery
SELECT this, that, theotherthing
FROM tblName
WHERE ID IN (#id#)
/cfquery

cfoutput query=listsQuery
#this#br#that#br#theotherthing#brbr
/cfoutput


~~
Kelly Matthews
Senior Programmer
[EMAIL PROTECTED]
http://www.allsoldout.net
703.387.4000 x 35
~~

__
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: simple cfloop

2002-03-03 Thread stas

You don't need multiple queries. Just run one query with WHERE ID IN
(#form.id#) and do a cfloop query = myQuery.

-Original Message-
From: Sorgatz, Rex [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, March 03, 2002 8:33 PM
To: CF-Talk
Subject: simple cfloop


Beginner CFer with an easy question. The situation: the user selects the
rows to query based upon ticking checkboxes. So, this is the first page:

form action=tally.cfm method=post
input type=checkbox name=id value=180
input type=checkbox name=id value=192
input type=checkbox name=id value=204
input type=checkbox name=id value=307
input type=submit value=go
/form 

Using a list and a cfloop to return multiple columns in only the rows
the user selects, what would the tally.cfm page look like? I'm looking
at something like this, but I know it's wrong:

cfloop index=ListIndex list=#FORM.id# delimiters=, cfquery
name=listsQuery datasource=xxx SELECT this, that, theotherthing
FROM tblName WHERE ID = #id# /cfquery 
cfoutput
query=listsQuery#this#br#that#br#theotherthing#brbr/cfoutput

/cfloop

Thanks for your help.


__
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists