Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Nested # signs - variable cfquery

Posted on 2003-03-29
4
Medium Priority
?
603 Views
Last Modified: 2013-12-24
I am sending a variable from one page to the next  called "person" - via http://page.cfm?person=#person#

the cfquery on page 2 looks like this:

<cfquery "address" datasource="whatever">
SELECT #person#
FROM book
</cfquery>

All i want to do is return a list of the row data from the column person; however, I have run into nested pound signs in my cfloop, i.e.:

<cfoutput>#address.#person##</cfoutput>
returns - an error about the "."

or if cfoutput query is used:

<cfoutput query="address">#person#</cfoutput>
returns - the variable value (i.e. Bob) for every datarow in table

any easy solution to this?

I tried put the variable together with <cfset> - if didn't work. I know I have incountered this before - just can't remember how I fixed it.

thanks for any help
0
Comment
Question by:flood92
4 Comments
 
LVL 8

Accepted Solution

by:
TallerMike earned 200 total points
ID: 8231425
<cfoutput>#Evaluate("address.#person#")#</cfoutput>

Or this:

<cfoutput>#Evaluate("address." & person)#</cfoutput>

Or this:

<cfoutput query="address">#Evaluate(person)#</cfoutput>
0
 
LVL 12

Expert Comment

by:jyokum
ID: 8231599
are you sure your query is right? if #person# resolves to Bob, your query is basically

<cfquery "address" datasource="whatever">
SELECT Bob
FROM book
</cfquery>

all this will return is the string "Bob". You probably want something like:
SELECT column_name
FROM book
WHERE person = '#person#'
0
 
LVL 17

Expert Comment

by:anandkp
ID: 8232831
A combination of above 2 suggestions shld help u out !

K'Rgds
Anand
0
 

Author Comment

by:flood92
ID: 8234314
Thanks TallerMike that worked.

jyokum - the query is right - "Bob" would be the datatable column name, i.e. I am selecting a column and displaying everything in the column. Bob would click on his name on the page to show his list of data on the next page.

Thanks again
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question